Surprising....

I typed up this in the playground and it seems to work.

// Get the data (from a JSON server call)
var JsonModel = {"author": "system", 
                  "fields": [{"default": null, "lowerbound": null, "type":
"string", "name": "filterfield", "upperbound": null}, 
                  {"default": null, "lowerbound": null, "type": "string",
"name": "filtervalue", "upperbound": null}]
                 };


// Create form
var theForm = new qx.ui.form.Form();
var controller = new qx.data.controller.Form(null, theForm);

// create the model
var model = qx.data.marshal.Json.createModel(JsonModel);

for(var fld in JsonModel.fields) {
  this.debug(fld);
  var formFld = new qx.ui.form.TextField();
  theForm.add(formFld, 'bla', null, 'fields[' + fld + '].name', this); 
  this.debug('fields['+fld+'].name')
}

controller.setModel(model);

var widget = new qx.ui.form.renderer.Double(theForm);
var doc = this.getRoot();
doc.add(widget);

Looks like something else is wrong in my application, I'll do some more
debugging. Thanks for pointing me to the playground.

BTW - is  this playground
<http://demo.qooxdoo.org/current/playground/#%7B%22code%22%3A%22%252F%252F%2520Get%2520the%2520data%2520(from%2520a%2520JSON%2520server%2520call)%250Avar%2520JsonModel%2520%253D%2520%257B%2522author%2522%253A%2520%2522system%2522%252C%2520%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2522fields%2522%253A%2520%255B%257B%2522default%2522%253A%2520null%252C%2520%2522lowerbound%2522%253A%2520null%252C%2520%2522type%2522%253A%2520%2522string%2522%252C%2520%2522name%2522%253A%2520%2522filterfield%2522%252C%2520%2522upperbound%2522%253A%2520null%257D%252C%2520%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%257B%2522default%2522%253A%2520null%252C%2520%2522lowerbound%2522%253A%2520null%252C%2520%2522type%2522%253A%2520%2522string%2522%252C%2520%2522name%2522%253A%2520%2522filtervalue%2522%252C%2520%2522upperbound%2522%253A%2520null%257D%255D%250A%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%2520%257D%253B%250A%250A%250A%252F%252F%2520Create%2520form%250Avar%2520theForm%2520%253D%2520new%2520qx.ui.form.Form()%253B%250Avar%2520controller%2520%253D%2520new%2520qx.data.controller.Form(null%252C%2520theForm)%253B%250A%250A%252F%252F%2520create%2520the%2520model%250Avar%2520model%2520%253D%2520qx.data.marshal.Json.createModel(JsonModel)%253B%250A%250Afor(var%2520fld%2520in%2520JsonModel.fields)%2520%257B%250A%2520%2520this.debug(fld)%253B%250A%2520%2520var%2520formFld%2520%253D%2520new%2520qx.ui.form.TextField()%253B%250A%2520%2520theForm.add(formFld%252C%2520'bla'%252C%2520null%252C%2520'fields%255B'%2520%252B%2520fld%2520%252B%2520'%255D.name'%252C%2520this)%253B%2520%250A%2520%2520this.debug('fields%255B'%252Bfld%252B'%255D.name')%250A%257D%250A%250Acontroller.setModel(model)%253B%250A%250Avar%2520widget%2520%253D%2520new%2520qx.ui.form.renderer.Double(theForm)%253B%250Avar%2520doc%2520%253D%2520this.getRoot()%253B%250Adoc.add(widget)%253B%22%2C%20%22mode%22%3A%22ria%22%7D>
  
visible to others than myself now? 




--
View this message in context: 
http://qooxdoo.678.n2.nabble.com/Data-binding-question-tp7582102p7582155.html
Sent from the qooxdoo mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Keep yourself connected to Go Parallel: 
INSIGHTS What's next for parallel hardware, programming and related areas?
Interviews and blogs by thought leaders keep you ahead of the curve.
http://goparallel.sourceforge.net
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to