Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

How to DataBind oValueHelpDialog SAPUI5

Hi Experts,

I wantto databind sapui5  oValueHelpDialog , I wantto databind from,

......./sap/opu/odata/sap/ZWEBDI_FIORI03_SRV/DiGoruntule?URUNTIPI='BD'&DINO='2120896'&REVNO='1'

here my controller,

var that= this;
var oValueHelpDialog = new sap.ui.comp.valuehelpdialog.ValueHelpDialog({
basicSearchText: this.theTokenInput.getValue(),
title: "Karakter",
modal: true,
supportMultiselect: true,
supportRanges: true,
supportRangesOnly: false,
key: this.aKeys[0], 
descriptionKey: this.aKeys[1],

ok: function(oControlEvent) {
that.aTokens = oControlEvent.getParameter("tokens");
that.theTokenInput.setTokens(that.aTokens);
oValueHelpDialog.close();
},

cancel: function(oControlEvent) {
sap.m.MessageToast.show("Cancel pressed!");
oValueHelpDialog.close();
},

afterClose: function() {
oValueHelpDialog.destroy();
}
});

var oColModel = new sap.ui.model.json.JSONModel();
oColModel.setData({
cols: [
{label: "Karakter", template: "Karakter"},
{label: "Tanim", template: "Tanim"}
//  ,
//  {label: "City", template: "City"},
//  {label: "Currency Code", template: "CurrencyCode"}
]

});

oValueHelpDialog.getTable().setModel(oColModel, "columns");

var oRowsModel = new sap.ui.model.json.JSONModel();
oRowsModel.setData(this.aItems);
oValueHelpDialog.getTable().setModel(oRowsModel);
oValueHelpDialog.getTable().bindRows("/");
Tags:
replied

where is your aItems??

In that example aItems is basically the rows data and in your code you are getting it from Gateway. so according to me you don't need to write all these codes.

var oRowsModel = new sap.ui.model.json.JSONModel();

oRowsModel.setData(this.aItems);

oValueHelpDialog.getTable().setModel(oRowsModel);

oValueHelpDialog.getTable().bindRows("/");

Just write this line and use the proper path of your Gateway service.

0 View this answer in context

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question