Skip to Content

Refresh page/model in SAPUI5

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.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    Feb 01 at 04:26 PM

    check if the model has the data you selected

    Add comment
    10|10000 characters needed characters exceeded

  • Feb 02 at 06:49 AM

    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.

    Add comment
    10|10000 characters needed characters exceeded

  • Feb 02 at 12:33 PM

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

    Add comment
    10|10000 characters needed characters exceeded