Show TOC

Multimodel SupportLocate this document in the navigation structure

SAPUI5 supports the use of more than one model for data binding.

You can set an additional model for an element or for the core by specifying a name for the model to identify it:

var oModel = new sap.ui.model.json.JSONModel();
// define data for that model
oModel.setData({
    		test: "Test", 
    		enabled: true
});

// define a name for that model
sap.ui.getCore().setModel(oModel, "myModel");

To create property bindings for this model call

oText.bindValue("myModel>/test").

You can also create aggregation bindings for this model by calling:

oListItem.bindProperty("text", "myModel>text");
oComboBox.bindItems("myModel>/items", oListItem);

You specify the model name and following the > sign you specify the binding path to the values in the model that is to be bound.

Note

You can create a model with an identifying name without first creating a model without a name.