Skip to Content
0

Refresh page/model in SAPUI5

Feb 01 at 02:03 PM

58

avatar image

Hello All,

I am trying to develop a SAP UI5 application with two views i,e HeaderView and DetailsView.

HeaderView has a list containing personnel numbers.When I click on any personnel number in this list,it takes me to the second view i,e DetailsView where I get the details for that personnel number in a Table.

Now for the first time,the personnel number that i choose from the list,it shows me the correct item details in the DetailsView.

But when I navigate back to the HeaderView and select any other personnel number,it shows me the same data as before in the DetailsView i,e data doesnot get updated.

Data only gets updated if i manually refresh the page.

I have tried using

this.getView().byId("THE_ID_OF_YOUR_VIEW").getModel().refresh(true);,

sap.ui.getCore().byId("THE_ID_OF_YOUR_VIEW").getModel().refresh(true);.

in the navigateToHeader() event as well in the onInit() event of the controller of the second view.

Tried refreshing the table as well.

But nothing works.

Any idea on this issue and how to solve it would be appreciated.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

3 Answers

SUBHAJIT DAS Feb 02 at 06:49 AM
0

I am quite new to SAPUI5 and Odata.

Can you please help me so as how I should check that the model has the data that I selected?

Thanks in advance.

Show 1 Share
10 |10000 characters needed characters left characters exceeded

Hi SUBHAJIT DAS,

You can try using map function

0
Jun Wu Feb 02 at 12:33 PM
0

show me the code that prepare the model/data for your detail view and when that code is executed.

Share
10 |10000 characters needed characters left characters exceeded
Jun Wu Feb 01 at 04:26 PM
0

check if the model has the data you selected

Share
10 |10000 characters needed characters left characters exceeded