Hello,
I am making my first steps in exploiting qooxdoo's data binding options (so
far I'm ashamed to admit I programmed everything by hand).
How do you like the concepts in general so far?

I have successfully managed to create a tree, a treeController and to use
the Json marshal to create a model from results obtained from an RPC call to
my server (web2py). So far so good.
Mostly the tree items I have are similar to each other, but some are
different and I would like to designate it by giving them different icons. I
have been trying to do this using a delegate, but it seems to me that the
configureItem function which I would like to use has no access to the model
generating the item, and hence can only set properties globally for all
items. Am I mistaken?
No, thats right. The configureItem method is only called when a item is added 
to the tree which means, it has not access to the model because that can change 
during time.

Is there a way of achieving different settings for
different items without having to either subclass the controller or
manipulate the tree after its creation by hand?
Manipulating the tree by hand is absolutely not a good idea because the 
controller will reformat everything as soon as something changes so you should 
never do that.
But there is an easy way to do that. The delegate also offers a method called 
"bindItem" which is the thing your looking for. You can use that to bind the 
property which is the unique identifier for the icons to the icon property of 
the tree item using a converter. Sounds a bit complicated but it isn't. I just 
wrote a demo for the list this afternoon which shows more or less the thing you 
want to do:
http://tinyurl.com/3esg8g4

A second question I have is - is it possible to use a "JSON-RPC" store to
bind the data instead of using RPC calls which generate a model using a
marshal and applies that model to the controller?
If there would be a JSON-RPC store, you could use it. But there is nothing like 
that. ;) But in general, the store would not do much more than the things your 
described, call the remote procedure and turn the response into a model. Not 
much magic about it as long as you can use the marshaler.

Regards,
Martin
------------------------------------------------------------------------------
5 Ways to Improve & Secure Unified Communications
Unified Communications promises greater efficiencies for business. UC can 
improve internal communications as well as offer faster, more efficient ways
to interact with customers and streamline customer service. Learn more!
http://www.accelacomm.com/jaw/sfnl/114/51426253/
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to