Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

How to Refresh Table in sap ui5

0 Kudos

Hi Experts,

  I am Facing issue over refreshing a table. ActuallyI had  binded table with a json model, and the table is editable.I am  input some data in to the cells.and now i want to refresh the table to it's previous position. I just used refresh button and used an event the code as follows

oRef:function(oEvent){

  //var otab=that.getView().byId("oTable1");

  //this.getView().byId("oTable1").setNoData();

  //this.getView().byId("oTable1").getModel().refresh(true);

  //this.getView().byId("oTable1").setModel(oModel);

}

please help me.....

1 ACCEPTED SOLUTION

pls help me anyone

5 REPLIES 5

pls help me anyone

0 Kudos

Hello,

since, refresh is not working, you can set backend data to model again, as below:

while reading the data from service take two copy of that data.

oBackendData = oData; //oData is coming from service response

oTableData = oData;

set oTableData  to oModel

set oModel to table

and in oRef function right below:

set oBackendData to oModel

set oModel to table again


now your table will be refreshed.


Note: you can read data again inside oRef function also, but two copy of data will avoid backend trigger


hope this will help you.



Regards,

Akhilesh

0 Kudos

Hi Akhilesh,

Actually I am using a locall model it's not coming from any service.

Regards,

Mutyam.

0 Kudos

here is a workaround, please check

https://jsfiddle.net/Akhilesh_U/ukv3hvet/4/

Regards,

Akhilesh

0 Kudos

Hi Akhilesh,


thanks a lot, man for your help.



Regards,

Mutyam.