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

Re: How to bind a single property to a value with oDataModel?

$
0
0

Hi Jack

One way would be to  use BindElement in your code to set the context see JS Bin - OData BindElement example

 

   var url = "http://exampleurlfordataservice/zui5_purchase_order_srv/";    var oModel = new sap.ui.model.odata.ODataModel(url, true);    sap.ui.getCore().setModel(oModel);    var oSearchField=  new sap.m.SearchField("sf1", {        value: '{Username}',          enabled: true,    }).placeAt("content");    oSearchField.setModel(oModel);    oSearchField.bindElement("/UI5UserParameters('USERNAME')");

Else set it statically

 

var oSearchField=  new sap.m.SearchField("sf1", {        value: '{/Employees(7)/FirstName}',   //Robert

Cheers

jsp


Viewing all articles
Browse latest Browse all 10473

Trending Articles



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