Quantcast
Channel: SCN : Unanswered Discussions - SAP Fiori
Viewing all articles
Browse latest Browse all 1879

How to reresh dropdown after new data from odata service "READ"

$
0
0

Hy,

 

I'am new in the fiori business and i'am struggling with the binding principles.

 

I created a combox in my XML view with a binding to my odata that has bin loaded by my WEBIDE. I get my list in my dropdown. So far so good but i want to refresh my list after an action by calling the backend again with a parameter. I get a return with different data, but i don't succeed in binding those new items to my drop down. I scanned in my opinion the hole internet but can't find a proper solution.

 

XML ( view1.xml ) :

<Combobox

id = "expenseID"

items = "{/ExpenseTypes}"

<core:Item key = "{ExpenseTypeID}" tekst = "{Description}"/>

<Combobox>

 

JS :

sap.ui.controller("view.view1",{

changeExpenseTypes: function(e) {

 

var model = this.getView().getModel();

var sUrl = "/ExpenseTypes?search=2";

 

model.read(sUrl, null, null, false, function(data, reponse) {

console.log('success');

console.log(data);

return data; });

 

}

});

 

When i call method changeExpenseTypes , i load my allready know model, calling my odata service ExpenseTypes , got a return of 5 new records and then i don't know what to do next to see those new records in my drop down.

 

Thanks in advance for your help or suggestions  !!

 

Greetings

Jonas


Viewing all articles
Browse latest Browse all 1879

Trending Articles



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