Skip to Content
0
May 18, 2020 at 01:22 PM

valueHelpDialog on mobile phone

105 Views

Hi,

I am using the valuehelpDialog in an app. It is working fine so far on a desktop. But when I run the app on a mobile device (here on Android) I get an error (t.map is not a function) as shown in the screenshot below made with remote debugging the phone.

The coding is more or less the same as the sample

https://sapui5.hana.ondemand.com/#/entity/sap.ui.comp.valuehelpdialog.ValueHelpDialog.

And t seems to be an array so t.map should be a function.

On a desktop the condition "e.bindItems" is never true. So the line causing the error on the phone is never reached.

Any idea whats wrong here or is there an alternative way to bind the items?

Thanks Michael

Here is the coding of the callback function:

onMatnrValueHelp: function () {

var aCols = {
cols: [{
"label": "Materialnummer",
"template": "MaterialList>Matnr",
"width": "10rem"
}, {
"label": "Materialtext",
"template": "MaterialList>Sgtxt"
}, {
"label": "Charge",
"template": "MaterialList>Charg"
}, {
"label": "Bestand",
"template": "MaterialList>Bestand",
"oType": new sap.ui.model.type.Float()
}, {
"label": "Einheit",
"template": "MaterialList>Meins"
}]
};
this.oColModel.setData(aCols);
this._oBasicSearchField = new SearchField({
showSearchButton: false
});

this._oValueHelpDialog = sap.ui.xmlfragment("SOC.SOConf.view.MatValueHelp", this);
this.getView().addDependent(this._oValueHelpDialog);
this._oValueHelpDialog.getFilterBar().setBasicSearch(this._oBasicSearchField);

this._oValueHelpDialog.getTableAsync().then(function (oTable) {
oTable.setModel(this.oModelMatList, "MaterialList");
oTable.setModel(this.oColModel, "columns");
if (oTable.bindRows) {
oTable.bindAggregation("rows", "MaterialList>/results");
}
if (oTable.bindItems) {
oTable.bindAggregation("items", "MaterialList>/results", function () {
return new mobileLibrary.ColumnListItem({
cells: aCols.map(function (column) {
return new mobileLibrary.Text({
path: "{" + column.template + "}"
});
})
});
});
}

this._oValueHelpDialog.update();
}.bind(this));
this._oValueHelpDialog.open();

},

Attachments

phone.jpg (124.9 kB)