Hello skar,

thanks for the typo hint. I fixed it in trunk. :)

Sure you can use the binding for such a scenario too. But you don't need a
controller for that. Just use the single value binding, which can replace
exactly your listener with one line of code. ;)
http://qooxdoo.org/documentation/0.8/data_binding#single_value_binding

var ​cb = new qx.ui.form.CheckBox("ABC");
this.getRoot().add(cb);
var sp = new qx.ui.form.Spinner(0, 10, 20);
this.getRoot().add(sp, {top: 30});

cb.bind("value", sp, "enabled");

Regards,
Martin


skar wrote:
> 
> MartinWittemann wrote:
>> Maybe you can take a look at the following demo:
>> http://demo.qooxdoo.org/current/demobrowser/#data~FormController.html
>>   
> http://demo.qooxdoo.org/devel/apiviewer/#qx.data.controller.Object has a 
> typo in
> 
>> If you want to *bin* a form widget, use qx.data.controller.Form 
>> <http://demo.qooxdoo.org/devel/apiviewer/#qx.data.controller.Form>
> It should be "bind" IMO.
> 
> Back to the topic under discussion, I've got a settings container, I've 
> got some settings where if one setting is true, then the next one is 
> enabled, else disabled. Like for eg, one setting would be "allow power 
> saving?" with a checkbox and the next would be "switch power save mode 
> after __ mins" which takes a number using a spinner or a textfield.
> 
> I'm using changeValue listeners to achieve this. I've got some dozen or 
> 2 of these settings and adding the listeners is tedious. Is there any 
> better way for this using forms/controllers?
> 
> cheers,
> skar.
> 
> -- 
> --
> The life so short, the craft so long to learn. 
> 
> 
> ------------------------------------------------------------------------------
> Join us December 9, 2009 for the Red Hat Virtual Experience,
> a free event focused on virtualization and cloud computing. 
> Attend in-depth sessions from your desk. Your couch. Anywhere.
> http://p.sf.net/sfu/redhat-sfdev2dev
> _______________________________________________
> qooxdoo-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
> 
> 

-- 
View this message in context: 
http://n2.nabble.com/help-understanding-data-binding-tp4106591p4111012.html
Sent from the qooxdoo mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Join us December 9, 2009 for the Red Hat Virtual Experience,
a free event focused on virtualization and cloud computing. 
Attend in-depth sessions from your desk. Your couch. Anywhere.
http://p.sf.net/sfu/redhat-sfdev2dev
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to