Hi,
Your product is perfect to quickly design very fast UI !
But I don’t understand the use of model.
I’d like to fill component like set text value of textbox … with data received using JSON without reload the full page.
But I don’t understand how to do that. I think I must use model but how to link the data received and models ?
A sample about using model would be apreciat.
Hope I’m clear enougth.
Thanks.
Christophe

1 answer

Staff February 1, 2016

Data models are not JSON in common case. JSON can be used to populate UI components hierarchy, like for instance it is demonstrated in “samples/office”. To load a text field with a text you should use AJAX request to get data and than set the text directly to your text filed component. For instance:   

var textField = new zebra.ui.TextField(new zebra.data.Text(""));
...
// Get context of the text field
zebra.io.GET("http://myweb.com/service/text", function(r) {
 if (r.status == 200) {
textField.setValue(r.responseText);
}
});
#1

Please login or Register to Submit Answer