Hi there,
I am building an app in which many checkboxes can be checked to make an booking. The checkboxes are inside a gallery which is also a collection.
I want to add an button / icon which resets all the chosen checkboxes and I also want the checkboxes to reset when I navigate from the screen to another screen.
I've tried some recommendations I have found on the forum however none of them seem to work
Can anybody help me with this problem?
Best regards
Eva
Solved! Go to Solution.
Hi @evalindag ,
Do you want to reset all Checkbox within your Gallery when you press the "Reset" button or navigate to another screen?
Based on the issue that you mentioned, I have made a test on my side, and don't have the issue that you mentioned. The screenshot as below:
Set the OnSelect property of the "Reset" button to following:
Set(IsReset, false);Set(IsReset, true)
Set the Reset property of the Checkbox within the Gallery to following:
IsReset
Set the OnHidden property of current Screen (which contains the Gallery) to following:
Set(IsReset, false);Set(IsReset, true) // Reset Checkbox when you navigate to another screen
Please consider take a try with above solution, check if the issue is solved.
Best regards,
Hi @evalindag ,
Based on the screenshot that you mentioned, I think this issue is related to the Default property of the Checkbox. Please remove the formula within the Default property of the Checkbox control.
If you set the Default property of the Checkbox to ThisItem.IsChosen formula, when you press the "Reset" button, it would reset the Checkbox to default value (ThisItem.IsChosen) rather than uncheck the Checkbox.
If you bind the Default property of the Checkbox to the IsChosen column in your collection, the Reset functionality would not work, because, the Checkbox would be check or unchecked based on the IsChosen column value in your collection.
Best regards,
Follow these:
1. OnVisible of the Screen use this:
UpdateContext({ResetCheckbox:false})
2. Put ResetCheckbox on each of the Reset of your checkboxes
3. Insert a button and OnSelect put: UpdateContext({ResetCheckbox:true})
Thus anytime you click on the button, the checkboxes woul be cleared
If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.
Hi @eka24 and thank you very much for your reply
I have tried implementing your solution into my app, however nothing happens when I push the button 😕
My checkboxes are used to patch into a collection, could that be the reason for this not working?
Regards
After creating the Variable, go to another screen before it takes effect.
If it does not work please give a screen shot. I have tried it.
If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.
I tried it, no luck.
I've also tried refreshing the app and opening and closing it, that doesn't work either.
The screenshot didn't post with the message, here they are 🙂
Everything you have done is OK.
Did you click the button with the UpdateContext formula and it did not clear? Please not the Push or submit button.
If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.
Hi @evalindag ,
Do you want to reset all Checkbox within your Gallery when you press the "Reset" button or navigate to another screen?
Based on the issue that you mentioned, I have made a test on my side, and don't have the issue that you mentioned. The screenshot as below:
Set the OnSelect property of the "Reset" button to following:
Set(IsReset, false);Set(IsReset, true)
Set the Reset property of the Checkbox within the Gallery to following:
IsReset
Set the OnHidden property of current Screen (which contains the Gallery) to following:
Set(IsReset, false);Set(IsReset, true) // Reset Checkbox when you navigate to another screen
Please consider take a try with above solution, check if the issue is solved.
Best regards,
Hi @v-xida-msft and thank you very much for your reply
However, I get the same problem when trying your solution, nothing happens when I push the button.
I took a screenshot of the advanced setting for my checkbox, as you can see I use "on check" and "on uncheck" to patch into a collection. Could that be the issue?
Hi @evalindag ,
Based on the screenshot that you mentioned, I think this issue is related to the Default property of the Checkbox. Please remove the formula within the Default property of the Checkbox control.
If you set the Default property of the Checkbox to ThisItem.IsChosen formula, when you press the "Reset" button, it would reset the Checkbox to default value (ThisItem.IsChosen) rather than uncheck the Checkbox.
If you bind the Default property of the Checkbox to the IsChosen column in your collection, the Reset functionality would not work, because, the Checkbox would be check or unchecked based on the IsChosen column value in your collection.
Best regards,
User | Count |
---|---|
122 | |
87 | |
86 | |
75 | |
67 |
User | Count |
---|---|
214 | |
180 | |
137 | |
96 | |
83 |