« Return to Thread: [Bug 624] New: cannot directly store getOrderedView collections in app.data

[Bug 624] New: cannot directly store getOrderedView collections in app.data

by Bugzilla from bugzilla-daemon@helma.at :: Rate this Message:

Reply to Author | View in Thread

http://helma.org/bugs/show_bug.cgi?id=624

           Summary: cannot directly store getOrderedView collections in
                    app.data
           Product: Helma
           Version: 1.6.2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Generic/Other
        AssignedTo: helma-dev@...
        ReportedBy: maksim.lin@...


If you store a collection created using HopObject.getOrderedView() directly in
app.data then when you fetch objects out of the collection using get(), you get
returned NodeHandler objects rather then the contained HopObjects.
eg.
app.data.booksByISBN = this.books.getOrderedView("isbn");
var book = app.data.booksByISBN.get(3); //book is NodeHandle NOT a HopObject

However if you instead store the collection inside another object, all works as
expected:
app.data.views = {};
app.data.views.booksByISBN = this.books.getOrderedView("isbn");
var book = app.data.views.booksByISBN.get(3); //Works OK!

I suspect this is to do with the collection returned from getOrderedView()
being a ListWrapper type and the way the Applications "data" cache property
handles the difference between native js and java host objects?

The work around is actually good programming practise (to more nicely sperate
out the app.data caches namespace) but I thought I'd submitted this just in
case anyone else runs into the same behaviour and gets confused as to why the
orderview collection misbehaves in this specific scenerio.


--
Configure bugmail: http://helma.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
_______________________________________________
Helma-dev mailing list
Helma-dev@...
http://helma.org/mailman/listinfo/helma-dev

 « Return to Thread: [Bug 624] New: cannot directly store getOrderedView collections in app.data

LightInTheBox - Buy quality products at wholesale price