cancel
Showing results for 
Search instead for 
Did you mean: 

how to get data from odata services in search field of value help

Former Member
0 Kudos

search method in controller of value help is posted.No reference of xml(like id of some list) is to be taken since the  search field is in the controller part of value help.plz help. 

if (oFilterBar.setBasicSearch) {

  

  oFilterBar.setBasicSearch(new sap.m.SearchField({showSearchButton:true, placeholder:"Search", enabled:true,

  LiveChange:function(){

  if (this.getValue().length > 0){

  var oDataObj = new sap.ui.model.odata.ODataModel("http://services.odata.org/Northwind/Northwind.svc/");

  //var oDataObj = new sap.ui.model.json.JSONModel("http://services.odata.org/Northwind/Northwind.svc/Categories?$format=json");

  sap.ui.getCore().setModel(oDataObj,"OdataObj");

  this.bindElement({ path: "/CompanyCodeValuehelp", parameters: {expand: "CompanyCodeName",select: "CompanyCodeName"}});

  }

  }})); 

  }

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

i have to implement search field in value help..s

hould i write this code in  the suggest function of search field or sumwhere else?

vijay_kumar49
Active Contributor
0 Kudos

please look at 

karthikarjun
Active Contributor
0 Kudos

Hi Monika,

SAPUI5 Explored - refer this

handleValueHelp  - Refer this method. It will clear your doubts


Thanks,

Karthik A

karthikarjun
Active Contributor
0 Kudos

Hi Monoka,

JSON Model - The JSON model is a client-side model and, therefore, intended for small datasets, which are completely available on the client. The JSON model does not support mechanisms for server-based paging or loading of deltas. It supports, however, two-way binding.

  1. var oModel = new sap.ui.model.odata.ODataModel("proxy/http/services.odata.org/Northwind/Northwind.svc");  
  2. sap.ui.getCore().setModel(oModel); 
  3. var oText = new sap.ui.commons.TextView("l1", {text: "{CompanyName}"});  
  4. oText.bindElement("/Customers('ALFKI')"); 
  5. oText.placeAt("content"); 

refer:

Thanks,

Karthik A

Former Member
0 Kudos

i have to implement search field in value help..s

hould i write this code in  the suggest function of search field or sumwhere else?