cancel
Showing results for 
Search instead for 
Did you mean: 

Model is not refreshed after apply on Navigation entity in Fiori Elements V4 App

Eike
Explorer
0 Kudos

Hello Community,

I have found a behavior, which I would not expect in our Fiori Elements App (using OData V4, ui5template.fiorielements.v4.lrop, Flexible Column Layout)

On the object Page I have bound an entity.

Also there is a table with 0..n to_subentity.

When creating a new entry or editing an existing entry in this table the "endcolumn" is opening and I am able to edit it there. All fine so far.

But:

After pushing the "Apply" button the changes are not visible in the table. It seems like a refresh is missing after pushing "Apply", because, when I refresh the whole page or pushing "Save" on the middle column page the changes are there. Is there any solution for that or is that the expected behavior?

Thank you for any advice.

Kind regards,

Eike

Eike
Explorer
0 Kudos

This issue was solved by using a newer version of SAPUI5 library

Accepted Solutions (0)

Answers (1)

Answers (1)

ashwink02
Explorer
0 Kudos

Hi Eike,

For this what you can to do is call the API which gets called during refresh. You need to check in Network Tab while debugging which API causes refresh.

In your case you need to attach event for the apply button of the table in OnInit

oTableApplyBtn.attachEvent("press", jQuery.proxy(this.onPressApply, this));

In this method you need to call the API and refresh the table model.

onPressApply:function(){

sPath="give your api path";

this.getView().getModel().read(sPath,

{

success:function(odata){

this.getView().byId(

"oTableApplyBtn"

).getModel().refresh();

}.bind(this),

error:function(oerr){

}

}

).bind(this);

}

This will trigger the refresh functionality.

Hope this was useful.

Regards,

Ashwin Kumar

Eike
Explorer
0 Kudos

Hi Ashwin,

Thank you for your answer.

I see two problems in this solution.

1. How to attachEvent on a generic button in Fiori Elements?

2. The read request of the new function onPressApply will be asynchron to the generic logic of the Apply Button. So the read request will not get the asynchron submited changes.

If you find any other solution, feel free to answer again.

Kind regards,

Eike