when designing the dialog, you will sepcify a prototype function, will be called upon confirming the dialog. This function is to hold the business logic, which you would normally have called, if the dialog would be modal.
This approch deals with the asyncronous execution of js code.
Manfred