cancel
Showing results for 
Search instead for 
Did you mean: 

Refresh page/model in SAPUI5

0 Kudos

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.

Accepted Solutions (1)

Accepted Solutions (1)

junwu
Active Contributor
0 Kudos

check if the model has the data you selected

Answers (3)

Answers (3)

ThorstenHoefer
Active Contributor
0 Kudos

Please check the topic routing / navigation and pass the personal number as a parameter to the second view.
Here you need to register the event "patternMatch"

Step 31: Routing with Parameters - Documentation - Demo Kit - SAPUI5 SDK (ondemand.com)

junwu
Active Contributor
0 Kudos

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

0 Kudos

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.

0 Kudos

Hi SUBHAJIT DAS,

You can try using map function

s_satyamsetti
Newcomer
0 Kudos

Hi Subhajit Das,

You can get your model data by using this.getView().getModel("ModelName").getData();

Thanks,