Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 9146

SAP m select Binding items By Id

$
0
0

Hello Experts,

 

So here is the situation:

 

view 1

var SelectCondType = new sap.m.Select(

  {

  id : "SelectCondType",

  width : "200px"

  });

 

   var oItemSelectTemplate1 = new sap.ui.core.Item({ 

             key : "{ID}", 

             text : "{Name}" 

         });

 

 

  var sServiceUrl = "blablabla.com:8000/sap/opu/odata/sap/YXM_GWS_BART_SRV";

  var oModel = new sap.ui.model.odata.ODataModel(sServiceUrl, false,

  "user", "pass");

 

  SelectCondType.setModel(oModel);

  SelectCondType.bindAggregation("items","/cond_type",oItemSelectTemplate1);

 

view 2

sap.ui.getCore().byId("SelectCondType").setSelectedKey(response.Condtype);

 

At the first view i have a sap.m.select which is already filled with id's and Name's.

And at the second view i wanna change the selecteditem of the sap.m.select so that it goes to

the item with the same key(id).

 

At the moment nothing happens. The selected item is just the one on top of the list.

 

Any Ideas?

 

Kind Regards,

 

Bart


Viewing all articles
Browse latest Browse all 9146

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>