cancel
Showing results for 
Search instead for 
Did you mean: 

How to refersh Master data list in fiori app?

former_member593030
Participant
0 Kudos

Hello Freinds,

I am using Master Detail fiori app,

In Detail screen - I have 2 buttons Accept and Reject.

When I Click on Accept - Record is created in SAP Backend and If Reject - then record is deleted in Backend.

Now, List in Master Screen is not updating after the above action is done.

Can Some please guide me? Or me sample application if i can see how this work.

I tried this,

sap.ui.getCore().byId("myList").getBinding("items").refresh();

Can anyone can help here?

Regards,

Sujoy

View Entire Topic
former_member306541
Participant
0 Kudos

Hello Sujoy,

you have to call the refresh-method at the odata model. The list will then update its bindings automatically.

Best regards,

Christian.

former_member593030
Participant
0 Kudos

Hello @Christian Späh,

You mean this one,

onRefresh : function () {
 this._oList.getBinding("items").refresh();
 },

former_member306541
Participant
0 Kudos

I meant something like this:

this._oList.getModel("items").refresh(true);

ui.model.odata.v2.ODataModel/methods/refresh

former_member593030
Participant
0 Kudos

Hello @Christian Späh,

I tried this console, but getting error.

"Cannot read property 'getModel' of undefined"

former_member306541
Participant
0 Kudos

Hello Sujoy,

if this._oList.getBinding("items").refresh(); works, my code should work, too.

You have to retrieve the odata model in your onRefresh function. Another way to do this is this.getView().getModel("items").

Best regards,

Christian.