Hi,
I'm trying to use the new "model" property in RadioButtons, here is what I
have done so far:


--code--

      var types =
      {
        "r" : "Type 1",
        "c" : "Type 2",
        "d": "Type 3"
      };

      this._fields["type"] = new qx.ui.form.RadioButtonGroup();
      this._fields["type"].setLayout(new qx.ui.layout.HBox(5));

      for (var type in types)
      {
        var radioButton = new qx.ui.form.RadioButton(types[type]);
        radioButton.setValue(type == 'r');
        radioButton.setModel(type);
        radioButton.setUserData("value", type);

        this._fields["type"].add(radioButton);
      }

-- code --

if I call: this._fields["type"].setModelSelection(['c']), "Type 2" is
selected as expected (very good).

But later on the code I have some bindings like:

  controller.addTarget(this._fields["relevance"], "value", "relevance",
true);

How do I set the binding to auto select the right choice depending on the
model.type value?

Do I need to use converters? I hope I don't need to use converters every
time I'm going to use RadioButtons.

By the way, new qx.ui.form.RadioButtonGroup(new qx.ui.layout.HBox(5))
doesn't work, is that suppose to be like that? Setting the layout later
works ok, though.

I guess an "else" is missing here:

    if (layout == null) {
      this.setLayout(new qx.ui.layout.VBox(4));
    }
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to