I have to second Martin that I think that qooxdoo databinding is really well
thought out and easy to use. To be sure, there is a small learning curve at
the beginning, so I think a separate tutorial would really help to get
people started.

I think it would be most helpful if such a tutorial would not start with the
logic of the databinding, but deal with the way people are thinking that
come from the world of HTML forms, so that much of the questions that keep
popping up on the list can be avoided. For example, the code

<select name='SelectionID'>
  <option value='1'>a</option>
  <option value='2' selected>b</option>
  <option value='3'>c</option>
</select> 

that is usually generated on the server side, with the "selected" tag
automatically set based on data, requires the "model2target" binding option
in the qooxdoo code:

fc.addBindingOptions("Gender", {converter: function(data) {
        // model2target
        for (var i = 0; i < listModel.getLength(); i++) {
          if (listModel.getItem(i).getId() == data) {
            return listModel.getItem(i)
          }
        }
        return listModel.getItem(0);
      }}, {converter: function(data) {
        // target2model
        return data.getId();
      }}); 

I think that is very counterintuitive *at first* when you are used to
dealing with HTML forms. It makes perfect sense from the logic of the
databinding implementation.

As I develop my application with SelectBoxes, I keep having to write those
for(){} loops for the reverse binding, so I wish there was a shortcut in the
implementation itself, something like
fc.setModelSelectionBasedOn("item","a"), but I can also live with writing
such a shortcut myself. My point is rather that it seems like the same
question keeps popping up on the list and you might make your life easier if
the databinding would be explained in more detail for the "common HTML
folks" ;-)

C. 
-- 
View this message in context: 
http://qooxdoo.678.n2.nabble.com/SelectBox-set-selection-tp4798272p4978783.html
Sent from the qooxdoo mailing list archive at Nabble.com.

------------------------------------------------------------------------------
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to