Hello Guys!
I’ve tried many things now. what I am trying to do is when deleting product from the bottom widget the checkbox of the same product in the top widget should be unselected.
I used repeated for both widgets.
Comparsion.rp (1.9 MB)
Hello Guys!
I’ve tried many things now. what I am trying to do is when deleting product from the bottom widget the checkbox of the same product in the top widget should be unselected.
I used repeated for both widgets.
Comparsion.rp (1.9 MB)
I’ve found that controlling/maintaining checkboxes in repeaters can be tricky, especially when they need to be set from outside as well as inside the repeater, and/or support row updates, filters, sorting, etc. By default a checkbox will change its own selection state (“true” = checked; “false” = unchecked) on click. If you need to “remotely” change this selection state for a unique row (from outside the repeater) and/or maintain its selection state when a repeater gets “touched” then things get out of whack.
This updated file may not be the most elegant solution, but it works and should be a reliable method.
Comparsion.rp (2.3 MB)
Here is what I changed:
There is still a potential issue: An item can be removed from “comparison table” either by clicking the ‘X’ button in that repeater, or unchecking the checkbox in “Accommodation list” except when there are 4 items chosen. At that point, all the checkboxes are disabled. So, you might want to rethink your logic for this, figuring out a way to disable only the unchecked boxes. Several ways you could do this, including adding another column for “DisableCompare” or somthing like that.
Thank you so much for helping me. it is a great solution.
there only one problem which when I delete products in the bottom widget from left to right it deletes 2 products at once from right to left it works well.
Not sure what could be the reason for this bug.
Appreciate your help
Well that’s no good! Looking at the code again, I notice the “remove” button hotspot has two actions: Update Rows of Accommodation List repeater, and Delete This Row (which I kept from your original) --but, when Accommodation list is updated–to uncheck the corresponding row’s checkbox–it also deletes the row in the comparison table repeater. Removing the “Delete This Row” from the hotspot fixes this issue.
A classic case of trying to do the same thing at the same time in two different places. I can’t decide if I’m surprised it worked at all, or if I’m surprised it failed. The best guess I can fathom is the “Update Rows” action causes the current Comparison row to be deleted, and then the “Delete This Row” action happens just after, but “This” gets shifted to the next row, so that next row gets deleted. If there is no next row (rightmost item) that action just gets ignored.
Thank you so much for helping me solve this problem and taking the time to detail the logic.
Much appreciated.