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

sap.m.Select - items contains only the last value passed by the model

$
0
0

Hi,

 

I am sure the solution is staring me in the face but at this stage I am getting nowhere.

 

I have a small program bound to an oData service that I can see is returning 6 rows with relevant data.

I bind this to a sap.m.Select control using a sap.ui.core.Item template in a bindAggregation call.

 

The result is a Select box but the contents is 6 rows containing the values of the last item returned by the oData service.

 

What am I missing ?

 

 

Code

var oModel = new sap.ui.model.odata.ODataModel('proxy/sap/opu/odata/sap/ZIL_MOB_TIMECONFIRMATION_SRV_01');

                    //oModel.read('/WorkCenterSet');

                    sap.ui.getCore().setModel(oModel);

 

 

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

         key: '{ShortText}',

         text: '{LongText}',

});

 

 

                    var oWorkCentDrop = new sap.m.Select('WorkCentDrop');

                    oWorkCentDrop.setWidth( '600px' );

                    oWorkCentDrop.bindAggregation('items', '/WorkCenterSet', oItemTemplate);


 

Thanks

Andre


Viewing all articles
Browse latest Browse all 8088

Trending Articles



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