Hi everyone, I'm new to outsytems and I’m trying to build a screen similar to the one in the screenshot and I could use some help. I have two tables: Department table Shows a list of departments Uses radio buttons, so only one department can be selected People table Shows a list of people Each row has a checkbox I also added a checkbox in the table header to select / deselect all rows Multiple people can be selected at the same time At the bottom, there is an Add button that assigns the selected people to the selected department. I’m mainly unsure about: How to properly implement the “Select All” checkbox in the table header How to keep it in sync when individual rows are checked or unchecked How to handle one selected department + multiple selected people when clicking Add What would be a simple and clean way to do this? Thanks a lot!
Hi,
Adding to Sherif’s answer: in the OnClick action of the Select All checkbox, you should also include a check to determine whether all rows are already selected. If all rows are selected, trigger the flow that deselects all of them. If not all rows are selected, trigger the flow that selects all rows instead.
Also the variable defined in the Select All checkbox should be turned to false when at least one row is not selected, or when all rows are selected after the individual update, the variable should be updated to True.
Hello @Ali Yolcu,
I may have a slightly different setup, but the idea is the same. In my case, I have an additional row that doesn’t exist in the actual table, it’s just a formula. In your case, you might already have an attribute like IsSelected. If that attribute is persisted, you’ll need to call the Update action. Otherwise, if your setup is similar to mine, there’s no server-side involvement.
Next, in the header cell, I added an On Click event. Inside it, I simply loop over the list and assign this attribute (either locally or on the backend) and set its value to True. Inside the same loop, you can apply the exact logic that you normally handle for a single record, by passing the current record as an input parameter and updating it so it reflects the actual business case not just selecting them on UI.
Hi @Ali Yolcu ,
For the check box all, you can create screen with template Lists from Outsystems.
Hope you will have an enjoyable experience with it.