cancel
Showing results for 
Search instead for 
Did you mean: 

this.getView().getModel in MDG Create Supplier Application

Former Member
0 Kudos
	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.

Accepted Solutions (0)

Answers (2)

Answers (2)

Sharathmg
Active Contributor
0 Kudos

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()

junwu
Active Contributor
0 Kudos

new Jsonmodel()