I want to ask a user for confirmation upon clicking submit on a form. I am not sure what tools to use to implement the logic.
I thought this would be possible with showDialog's callback even though I wasn't sure how to communicate the "ok" and "cancel" signals, in any case it turns out that the success callback is called as soon as the dialog displays (maybe on attach or otherwise). So I am not sure how to have some clean logic that does the confirmation.
In more details, the goal is to upon submission prepare lots of data for the item/record creation, then present a summary to the user and ask for confirmation. What I hoped to achieve was to have after data preparation a call to a dialog that will halt the execution at that call and return with confirmation or denial at which point the record will be created or not.
One way I see how the confirmation can be done is to send all the data to the dialog page which in turn will create the record upon confirmation. But this seems unnecessary, non-reusable and honestly tedious, so is there a better way of making a confirmation dialog?
Your form and the confirmation dialog should both have the same datasource, i.e. the create datasource should be same for both. Once you have this set up, you bind the values to labels/textboxes inside the dialog. Then, all you have to do is to create the item on the dialog's OK button or just close the dialog on the dialog's CANCEL button.