Skip to Content
0
Former Member
Aug 01, 2016 at 09:17 AM

Update single row/property on sap.m.List

402 Views

How to update a single row (or property) on sap.m.List on master view?

I have a simple master/detail application (based on OData model). The master view displays a list of invoices with their status. The detail view displays the actual invoice details. It is possible to save the changes for an invoice from the detail view (=update call in the Odata service for single invoice). This all works perfectly.


Saving/updating the invoice might change the status of the invoice (e.g. from "Waiting for approval" to "Approved"). I would like to refresh the list on the master view that it would display the updated status immediately after saving/updating the invoice.

Is there a way to somehow just update either single row in the sap.m.List or single property (=the status) in certain row? I would like to avoid doing any kind of refresh for the whole model or loading the list again from backend (=slow).

So far I have tried:

- Calling odatamodel.read("InvoiceList(pathToInvoice) etc after saving the invoice. This seem to update the model with the new status, but the master view/list still displays the old status.

- odatamodel.setProperty. This returns success, but the list still displays the old status.

Please note that the master view's list and the detail view have a binding for different entity sets (the key is the same "invoice number").

Any ideas or recommendations?

Kind regards,

Karri