checkbox selection looses in other pages

Hai,
 I have checkboxes for each line in the table records, and a bulk select widget from the RICH WIDGETS in the header of the table along with the titles of columns. 

It works fine the selection of all lines of the table records, HOWEVER, if I go to click in the another page (page 2, or 4 or whatever) the bulk select looses its selection, the tick disappears... how can we fix this? 

Hi Jeyasri,

This can't easily be solved, though depending on the way you implemented your pagination there may be a way to keep the checkboxes. What happens, is that when you advance a page, the query is reexecuted and the Table Records refreshed with that data, and any check boxes are overwritten.

So, to keep the value of the check boxes, you'll need to come up with a solution that retrieves the current values, saves them somehow, refresh the query and Table Records, then re-apply the values. This can be done in a number of ways, depending on the kind of data you have and the needs you have for it.

Note that if you have a fairly small set of data, that you can read once and then use also for pagination (so without refreshing the query), the process is a little easier, as you can then just copy the Table Records contents to its Variable, then refresh. but don't try this with large data sets, or performance will be bad!

Hi Jeyasri,


Assign Start Index with a Integer Variable. "StartIndex" in my case as seen in above screenshot

On Notify of the List_Navigation of the Rich Widget will have the following action:

Assign the output of List_Navigation_GetStartIndex to the StartIndex Variable. Ajax Refresh Table Record and List Navigation Web Block.


Note: In my case, The source record list has a variable (with list data type). 

Also the variable of the check box is assigned with one of the columns of the list assigned to the table record. (Boolean Data Type)

I hope this solves the problem.


Regards,

Rushabh


Jayasari,

What I have done in some scenarios (where I don't want to persist this information in the database) is to store that state in the browsers local storage or session storage (which one you use depends on how long you need this to be stored)

I found this component that helps with that:

https://www.outsystems.com/forge/component-overview/4990/local-storage

So what you can do is to have a collection stored in your storage, and add/remove whenever an item is selected/deselected. You would need to check this collection any time the state of a checkbox is changed to add or remove things and whenever you change a page you can iterate through that list and set any items that are there to have Select as true (On the RefreshAddressTable screen action).


Andres Moreno

Hi Andres,


Does that mean storing list of data in session storage?


Regards,

Rushabh