Hi Simon,

since you only want to display the details of the selected item, the 
list's selection seems like the obvious choice as a binding source. 
"value" would be the target on the text field. Assuming your model 
objects have a "detail" property, you could do something like this:

list.getSelection().bind("[0]", textField, "value", {
   converter : function(data) {
     return data.getDetail();
   }
});

One caveat: The "bind" call will immediately try to apply the value to 
the target property. If you don't use the "one" selectionMode for the 
List, there won't be an initial selection, so "data" in the converter 
will be undefined. So either use the "one" selection, or add a check to 
the converter.


Regards,
Daniel

On 09/16/2011 10:26 PM, Simon White wrote:
> Hi
>
> I have a virtual list bound to a store and it displays the data
> correctly.  Now in typical master/detail fashion I would like to show
> the details of the selected item.  I am wondering how best to do this.
> Do I bind the textfield to field in the model or do I add a listener to
> the "change" event of the list and use a function to set the textfield
> value?
>
> It seems simpler to bind to the model but I am not sure how to do that
> since I cannot find the appropriate "value" property of the textfield.
>
> Thanks,
> Simon
>
>
>
>
>
> ------------------------------------------------------------------------------
> BlackBerry® DevCon Americas, Oct. 18-20, San Francisco, CA
> http://p.sf.net/sfu/rim-devcon-copy2
> _______________________________________________
> qooxdoo-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>
>

------------------------------------------------------------------------------
BlackBerry® DevCon Americas, Oct. 18-20, San Francisco, CA
Learn about the latest advances in developing for the 
BlackBerry® mobile platform with sessions, labs & more.
See new tools and technologies. Register for BlackBerry® DevCon today!
http://p.sf.net/sfu/rim-devcon-copy1 
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to