cancel
Showing results for 
Search instead for 
Did you mean: 
Subscribe

We have a bunch of custom free-style Fiori apps created a few years ago, that contain code like this in the attachPatternMatched method of the router object:

var oElementBinding = this.getView().getElementBinding();
if ( oElementBinding.getBoundContext() ) {
	oElementBinding.refresh(); 
}

This is to ensure if the user navigates away and then back to an Object page, the view's elementBinding gets refreshed from the backend (because view.bindElement( ) does not call the backend if user navigates away then back to the object page).

This has worked fine so far until we upgraded to SAPUI5 1.71.53 (from 1.71.48), and now it doesn't refresh.

We found that if we add the parameter true, it works as before:

oElementBinding.refresh(true); 

Now, I know we should have had the "true" parameter from the start, but why would that make a difference in 1.71.53, and not 48. The parameter is supposed to only matter if the model has not changed, in our cases the model has changed, so the refresh should work even without the parameter.

Would appreciate any recommendations, on what the proper way is to ensure models are updated as user navigates between pages.

Thanks

0 Likes
View Entire Topic
shobhit2108
Explorer
0 Likes

Hi Ramin,

As per my knowledge the refresh() function fetches data from the back end service and updates the model. It doesn't update the bound controls.

In case you need to update the controls that are are bound to this model,whose data has been changed, you need to pass in the true parameter which forces the controls to be updated.

I think your apps needs to update the bound controls with new data and hence this param would be needed to do so. Without this, your model would definitely show the changes but control would not.

Hope it helps.

Thanks

Shobhit Pathak

RaminS
Active Participant
0 Likes

Are you saying this:

this.getView().getElementBinding().refresh(); 

does not refresh the view controls?