Skip to Content
0

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

Aug 17, 2017 at 10:39 AM

36

avatar image
Former Member
	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.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Jun Wu Aug 17, 2017 at 11:56 AM
0

new Jsonmodel()

Share
10 |10000 characters needed characters left characters exceeded
Sharath M G Aug 18, 2017 at 05:40 AM
0

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

Share
10 |10000 characters needed characters left characters exceeded