Skip to Content

Retaining the selection of rows in sap.m.Table , even when the binding changes.

May 26, 2017 at 09:49 AM


avatar image

Hi Experts,

I have a requirement in which i have to provide multiple row select property to the given sap.m.Table. Once the rows are selected , i have to fetch the selected rows only into the same table by eliminating the rest of the rows. I did this using runtime json.

The problem is - Once the user presses the "SHOWALL" button , the table should show all the previously present selected or unselected items, irrespective of their selection. But the rows selected previously should remain selected(the corresponding checkboxes of the selected rows should remain checked ) as earlier.

I am attaching my code with this.code.txt. Please tell me whether it is possible to achieve this ?

Thanks in advance.

code.txt (8.6 kB)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Best Answer
Ramesh Shrestha May 26, 2017 at 12:59 PM

Hi Aman Anand,

You can have one property value in your model "Selected" : "false". Bind it to the item property "selected".

So automatically when you make selection. The model will be updated and it will retain

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

Hi Ramesh,

I have tried to bind the "Selected" property. Yet the model updation doesn't seem to happen. In my case i have to change the binding property two times in order for getting the desired result. But the seconde time the binding is not working as it should.

Kuppireddi Sireesh May 26, 2017 at 02:01 PM

Set property rememberSelections to true or false for the table depending upon your requirement.

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

Hi Sireesh,

I tried setting the RememberSelections to true. But it is not working. I guess some coding is also required in order to do that.