11
Views
4
Comments
Solved
Checkbox in a list selecting all rows instead of 1
Question

Hi. I am having issues with a checkbox that is inside a list. If i select the first row, the checkbox multi selects all rows. I only want it to select one row at a time attached is a screenshot. I only selected october but Nov and Dec were automatically ticked.

Rank: #70
Solution

Hi RUDO,


In order to have one checkbox per line, you need to have one boolean per line.

You can do that by having on the query you have binded to the list, by adding a Boolean attribute, for example IsSelected. This attribute will hold the value if the checkbox for each row is selected or not:

It starts at False, so all the checkboxes start empty.

And then your checkbox should point to the IsSelected attribute of the current row:


Hope it helps.


Regards,
João

Rank: #828

Looks like aLL your checkboxes are bind to the same variable without any argument. If you do not have a boolean value in the table that you can use then OutSystems allows to create new attributes during preparation that are not actual columns but can be used to assign and validate: 


Rank: #292

Hi Rudo,

You need to create a calculated attribute 'IsSelected(type boolean)' inside your aggregate and use this attribute in your list checkbox. This way it will make IsSelected attribute to true for selected record in your data source.

You can check following link to know how to create Calculated Attribute inside an aggregate.

https://success.outsystems.com/Documentation/11/Developing_an_Application/Use_Data/Query_Data/Create_a_Calculated_Attribute_in_an_Aggregate


Hope this will help you, Thanks!!