Hello Christian, i have fixed the bug and checked back the the original demo you postet in here.
You can add now two converters for the type which will extract the value property: var model2target = {converter: function(data) { for (var i = 0; i < model.getLength(); i++) { var item = model.getItem(i); if (item.getValue() == data) { return item; } } return model.getItem(0); }}; var target2model = {converter: function(data) { return data.getValue(); }}; formController.addBindingOptions("type", model2target, target2model); But just to clarify things up, i did not mean you are mixing up the models. What i think is that you are using two different kinds of data in one model, in the model for the SelectBox. The value property in that model is what i would call a data model and icon and label are more a ui model. Regards, Martin panyasan wrote: > > Hi Martin, > > > MartinWittemann wrote: >> >> Hello Christian, >> i think you are mixing things up a bit. You are using two kinds of >> models, the first one for populating the selectBox is a model containing >> a mix of information: on part is the data model and the other part is the >> view model. The data model part is that part you want to have in the form >> model (also a data model) at the end and the view model part is not >> needed there. So maybe you should just use the data model part as model >> and configure the view on a different way? >> Anyway, i opened a bug report for supporting options for the form >> controller. (http://bugzilla.qooxdoo.org/show_bug.cgi?id=2822) With that >> it is a easy task to supply your needs. >> > > Thanks for looking into this. Howeer, I am not mixing up view part and > data part - the population of the SelectBox is completely separate from > the population of the form - I use different data stores for them. See > this screenshot: > > http://n2.nabble.com/file/n3684263/screenshot-form-selectbox.png > > The select box "Reference Type" is populated from a remote data store > before the form data is applied to the form. The model data contains > "icon" and "label" properties plus a "value" property which is used to > match the select box items to the form data. The form data is a simple > json object > > { reftype : "book", author: "Foo, Bar", title : "Bla bla bla" ... } > > converted by the qx.data.marshal.Json to a qooxdoo object. And now you > have the core of the problem: there is an identifier in the select box > model data which matches a form data value (for example "book") to the > item in the model qx.data.Array which contains the "value" property > "book". > > The main reason why I am not handwiring this is that the form that you can > see in the screenshot is dynamically constructed. > > Again, thanks for taking time to think about this! > > Christian > -- View this message in context: http://n2.nabble.com/How-to-use-data-binding-for-a-SelectBox-which-is-intended-for-single-selection-tp3656721p3693821.html Sent from the Q&A (solved) mailing list archive at Nabble.com. ------------------------------------------------------------------------------ Come build with us! The BlackBerry® Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9-12, 2009. Register now! http://p.sf.net/sfu/devconf _______________________________________________ qooxdoo-devel mailing list qooxdoo-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel