In some cases, that is a good enough workaround. But it also means that as afar as working with the data-bound widget in Javascript goes, you only get the IDs.
Sometimes, I need controller.getSelection() to give me the model objects to work with, but I also want to be able to do: controller.getSelection().push(15) or: controller.getSelection().push(duplicate_instance) That is: select an item that I do not have the original instance of, because I serialized a new instance from the server. It's like if you had to implement a server-side search function for the Qooxdoo feedreader demo. If the server returns feed object IDs and article IDs, how would one update the feed reader UI widgets to jump to a particular search result? I am using a helper to search my trees now, but it's not a pretty approach either. My thought was a custom Qooxdoo identity system: If each qx.core.Object had a "_getIdentity()" method, the user could implement this method at his discretion. If it is missing, things work just the way they do now. The data binding controllers would have to be updated to use this new identity system instead of the native JS identities. This is obviously a significant addition, and I don't know about the design considerations involved. I wonder how other frameworks solve this. But I do feel like something is missing here. In the linked thread, a further idea was discussed, which I think would be useful as well, though it solves a different problem: a marshaller than helps with resolving references. In a feed reader, if I query the server for a list of articles of the feed the user just selected, and each article has a "feed" property pointing to the feed it belongs to, then I want article.getFeed() to return the same instance of the Feed object that is already loaded. Michael On 19.08.13 13:45, Martin Wittemann wrote: > Hey, > I don't grasp the whole spirit of the question so maybe my answer might be a > bit odd. But the thread you linked is, as far as I can remember, only about > syntactical sugar. You do have the possibility to use that server generated > id as model for each item by implementing the bindProperty method of the > delegate. But that would not solve your problem of the search algorithm. > So you think of some kind of helper for tree searches? > Regards, > Martin > > Am 07.08.2013 um 15:42 schrieb Michael Elsdörfer <[email protected]>: > >> I take it this has been discussed before a number of times, e.g. >> >> http://qooxdoo.678.n2.nabble.com/Adding-quot-modelPath-quot-property-to-qx-data-controller-List-td6648554.html >> >> So I construct a tree using databinding. I then have a server-side >> search function that returns objects or object ids of the type used by >> the tree model. I want to select one of the objects indicated by the >> server in the tree. >> >> What Qooxdoo would have me do now is iterate over the tree, recursively, >> in order to find the correct instance to add to the selection. >> >> I could also manually keep a hash of ids => instances, and maintain that >> hash whenever new objects are created/deleted. >> >> Quite possible to do, of course. But no fun whatsoever. Shouldn't >> Qooxdoo desire to make this use case, and related ones discussed in the >> link above, easier for the developer? >> >> Michael >> >> ------------------------------------------------------------------------------ >> Get 100% visibility into Java/.NET code with AppDynamics Lite! >> It's a free troubleshooting tool designed for production. >> Get down to code-level detail for bottlenecks, with <2% overhead. >> Download for free and get started troubleshooting in minutes. >> http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk >> _______________________________________________ >> qooxdoo-devel mailing list >> [email protected] >> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel > > > ------------------------------------------------------------------------------ > Get 100% visibility into Java/.NET code with AppDynamics Lite! > It's a free troubleshooting tool designed for production. > Get down to code-level detail for bottlenecks, with <2% overhead. > Download for free and get started troubleshooting in minutes. > http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk > _______________________________________________ > qooxdoo-devel mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel > ------------------------------------------------------------------------------ Get 100% visibility into Java/.NET code with AppDynamics Lite! It's a free troubleshooting tool designed for production. Get down to code-level detail for bottlenecks, with <2% overhead. Download for free and get started troubleshooting in minutes. http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk _______________________________________________ qooxdoo-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
