Hey.
Thanks for the rewrite. I just changed the paragraph in the manual with your
input.
https://github.com/qooxdoo/qooxdoo/commit/995b0781085c723659153d0215f7f2d655880b9c
Best,
Martin
Am 30.05.2013 um 00:44 schrieb wgw
<[email protected]<mailto:[email protected]>>:
Binding an implicit property through methods and events
Some properties of objects used as models can only be accessed through a
method or an event. Those properties cannot be bound directly, but they can
be bound through a method or an event that references them. One common case
is the TextField widget, which does not have a direct "value" property,
unlike the Label of the previous example, which does have a "value"
property. The "value" of a TextField is only addressed through getter /
setter methods and change events. Indirectly therefore Textfield does indeed
have a property for binding, though it is not implemented as a direct
property. Using the changeValue event, "value" can be bound as is shown in
the example snippet. The API is essentially the same as the property binding
case.
var textField = new qx.ui.form.TextField();
var label = new qx.ui.basic.Label();
textField.bind("changeValue", label, "value");
As you can see, the same method has been used. The difference is that the
first argument is a data event name and not a property name.
In a similar fashion, a controller can bind to the implicit "value" property
of the Textfield:
var textField = new qx.ui.form.TextField();
// create the controller
var controller = new qx.data.controller.Object(model);
// connect the name
controller.addTarget(textfield, "value", "name", true);
In this case the binding code translates the "value" property into
getValue() and setValue() methods.[?? do not know when binding should be to
the implicit property and when it should be to the change event.]
------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:
Build for Windows Store.
http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel