Thanks so much for nudging me in the right direction. I rewrote that
paragraph on binding events [1] in a way I understand (see below).  As I was
rewriting, I realized there is still one mystery. 

When I use .bind, it appears I can only use events (changeValue) as targets:

         textField.bind("changeValue", label, "value");

That works. I cannot use "value" in place of "changeValue". On the other
hand, with a controller, I use the indirect property (value), rather than an
event. "ChangeValue" won't work: 

     var controller = new qx.data.controller.Object(model);
     controller.addTarget(textfield, "value", "controllerValue");

Is that generally the case (event for .bind/ value for controller)? Are
those the only places where there are different binding configurations?

Thanks!


========rewrite ===============
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.]



--
View this message in context: 
http://qooxdoo.678.n2.nabble.com/demobrowser-data-Form-example-are-controller-target-properties-in-the-api-viewer-tp7583765p7583779.html
Sent from the qooxdoo mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Introducing AppDynamics Lite, a free troubleshooting tool for Java/.NET
Get 100% visibility into your production application - at no cost.
Code-level diagnostics for performance bottlenecks with <2% overhead
Download for free and get started troubleshooting in minutes.
http://p.sf.net/sfu/appdyn_d2d_ap1
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to