on 08-17-2017 11:39 AM - last edited on 02-04-2024 12:10 AM by postmig_api_4
var oCountryDialog = new sap.m.SelectDialog({
id: "CountryDialog",
title: this.getView().getModel("i18n")
.getProperty("COUNTRIES"), // "Countries",
noDataText: this.getView()
.getModel("i18n").getProperty(
"LOAD") + "...", // "Loading...",
items: {
path: "/CountryValues",
template: new sap.m.StandardListItem({
title: "{CountryName}",
description: "{CountryKey}"
})
},
var sQuery = "/CountryValues";
if (this.oCountryValueHelp === "") {
var oModel = this.getView().getModel();
oModel.read(sQuery, null, null, true,
function(result, oError) {
if (result.results.length > 0) {
var oItemTemplate = new sap.m.StandardListItem({
title: "{CountryName}",
description: "{CountryKey}",
active: true
});
<br>
I am trying to create a custom application similar to SAP MDG Create Supplier APP (BSP App- SAP_REQ_SUPPL.
While trying to create a value help for country, there is a code as below:
var oModel = this.getView().getModel();
While I am trying to incorporate this, I am getting error as getModel() is not defined. I cannot figure out where to define a model or so.
Could you please help.
If you want to get a particular model, then use the name of model.
In this case, if you are creating a new model, use var oModel = new sap.ui.model.json.JSONModel()
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
new Jsonmodel()
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.