Checkbox: it's not refreshing the init value if I sort the table based on the fact is it's checked or not

So I have this dataset with one of the fields “is_selected” and I have a sort on this field to have the checked at the top of the table, it’s a collection list btw.

Now when I check a random checkbox, it updates the “is_selected” of the data in this row and this one goes to the top. Great.

BUT the row that I checked, stays checked. So the one that went to the top is also checked and the exact row that I checked is also checked, while the value of that row’s is_selected = false.

How can I force the checkbox to check itself and it’s data to make sure it should be checked true or false…?

Also on deselecting, the one that I deselect jump to the bottom but on that specific row it stays uncheked (while that row’s data is now one with is_selected=true).

As you can see in the screenshot, the “is_selected” value for exactly this row is false but the “preview” shows the checkbox checked. So to rephrase the question; how to let the checkbox check if it has the right value?


Hello @alexanderl,

It’s a limitation of WeWeb, you are in a repeat item and we have no way to identify each item, we are using the index on our side.

In the item that is repeated, you can go to the setting tab. Add a new attribute. You can name it key and bind the value to a unique key of your data

Ah that makes sense. Thanks will give it a go!

Hey @Mael , I’m sorry but it didn’t work. I gave the flexbox with the checkbox an attribute id and set it to a unique value of that row. Also tried with the checkbox itself giving it an attribute id. Same thing. Any tips?

Could you please share a screenshot of what you did? If you could send the layout in the screenshot, it will be perfect to help you

Were you able to resolve this? We are having a very similar issue.

I was not able to resolve this. But looking at it again now. @Mael can you explain maybe which element exactly needs the ID? I tried adding the ID to the entire row, but also to just the checkbox or the flexbox around the checkbox. But no success just yet.

So starting with nothing selected:

Then clicking Career Bridge, will bring Career Bridge to the top, but also keep the checkbox I just clicked, selected at the same row. So now we have 2 checkboxes selected. The bottom one should not be selected as I just wanted Career Bridge to be selected.

Here’s the setup for the row/checkbox or flexbox, all tried seperately and also combined:

Hello @alexanderl,

You need to set it for the entire row. But that’s my bad, I will update the previous answer I sent, could you try to set the key as id

Cool, that worked!