Skip to Content

sap.m.select binding with oData filter

Hi,

I wondering if it is actually possible to bind an oData filter query option to sap.m.select. I have this example:

var oSelectTemplate = new sap.ui.core.Item({ key : "{key}", text : "{text}" });
var oSelectBox = sap.ui.getCore().byId("SelectBox");
var sPath = "/datapath?$filter=Matnr eq " + "'" + vMatnr+ "'";
oSelectBox.bindAggregation("items", sPath, oSelectTemplate);

But this somehow doesn't work. I see the GET call where I receive two different materials for e.g. MAT111 and MAT999. But in the selection I only get displayed MAT999 twice. The first key is overwritten with the second key.

Thanks

Andreas

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    May 26, 2015 at 03:23 PM

    I found the solution, it actually was an error in the oData service. Matnr wasn't specified as key but a different entry. I defined it as key and now it works.

    Add comment
    10|10000 characters needed characters exceeded