on 01-29-2017 12:47 PM
Hi,
could you please help with this issue regards value help dialog? My code looks as follows: (based on the UI5 Explored)
Component.js:
// Create and set domain model to the component
var oModel = new sap.ui.model.odata.ODataModel(sServiceUrl, {
json: true,
loadMetadataAsync: true
});
this.setModel(oModel);
In the controller:
oValueHelpDialog.getTable().setModel(sap.ui.getCore().getModel("oModel"));
//var oRowsModel = new sap.ui.model.json.JSONModel();
//oRowsModel.setData(this.aItems);
//oValueHelpDialog.getTable().setModel(oRowsModel);
if (oValueHelpDialog.getTable().bindRows) {
oValueHelpDialog.getTable().bindRows("/SoldToSearchSet");
}
I do not get any data visible, what is wrong with my databinding?
Thanks,
Tim
Hello Tim,
You have set the model on the component but while accessing you are the global ui5core model and therefore not visible. In the controller you have reference to the Owner Component.
Another option is to set global model by using sap.ui.getCore().setModel() -- But this is strictly not recommended.
The solution is - In controller file
oValueHelpDialog.getTable().setModel(this.getOwnerComponent().getModel("oModel"));
This way you will be able to have the component's model set to value help table. Hope this helps.
Thanks and Regards,
Veera
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
sap.ui.getCore().setModel(oModel)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.