Skip to main content

I have a multi-select field that is populated with values from a DB table.  The user fills in the multi-select and upon clicking Next on the form, saves those values in a semi-colon delimited field in another DB table for the request.  It also creates a row in a 3rd table to keep track of additional details for each of those selected values on the next screen.  

 

Here is my problem.  If the user goes back, I want the view to show a confirmation message to the user telling them it is going to clear any of their details.  This works great on a change event (although was a little tricky to implement with the Initialize firing the "change") and works if the user clicks "OK".  If, however, the user clicks "Cancel" on the confirmation box, it doesn't fire the clear event but it still moves the value they selected to the wrong side (so now the values are out of sync with the details table).  How do I make it so the Cancel of the confirmation resets the multi-select back to the original values that were set?  I can't figure out how to make the rules run something "else" on cancel - only if they click OK!

 

Hi,


 


Are you setting up something similar to this? Perhaps, another approach is to temporary hold the values from multi-select control in a data label control before saving it to the database.


1. Capture multi-select values to a data label control via 'transfer data' action.




2. The Backbutton rule can be setup similar to this.



3. Setup an unbound rule to save data into your backend tables. This can be call from either Next or Back button.


I'm not sure I fully understand... you popup a confirmation box asking the user if it is ok to clear fields. If they click "OK", it should clear the fields and if they click "Cancel" it should do nothing? Or do I have this backwards? I pretty much try to design my confirmation boxes in such a way that cancel does nothinig as it can be tricky to wire in rules to that particular event.


So the issue with what you have below is i don't want to clear their values upon clicking Back.  They can go back and look at their stuff on the first view/tab.  The issue is if they change the multi-select field itself.  So i put my rule on the multi-select change event to bring up the confirmation.  

 

The problem is that when I do that, even after clicking Cancel, the values for the multi-select are out of sync now with what was saved previously.  And there is no way to run a different set of rules if they click Cancel out of the confirmation box.  Only to run rules if they click OK (which is what I want to do to erase the rows out of the DB).   I can't run a clear because there is no "Else" option as part of the rules when the user clicks Cancel.  


You may want to consider making your own simple dialog that can handle OK and Cancel seperately, instead of using the built-in confirmation box.


Reply