Archive: how to determine which button is pressed?


how to determine which button is pressed?
How can I detect if the user has pressed the next / back / cancel button? can I change the actions executed ?

Thanks.


The page Leave function is only executed when the user clicks the Next button.

Stu


Ok, and if the user click the back function? Or he selects cancel ? there are perhaps equivalent functions (next button --> leave Function, back --> start function (for example?))?
In my mask I have some mandatory fields. When the user clicks the next button, I test if the fields are empty: if so, using a Goto instruction, I return to the correspondent label, at the beginning of the function. But if the user clicks the "Back" or the "cancel" options, how to detect it?
if he choose "back" I would return to the previous page, if he choose cancel I woul abort the installation. thanks


If the user clicks 'back', then then install will go back to the previous page (no additional programming necessary).

Assuming that your page is a custom page, you can (in your page's show function) pop a value off the stack to indicate which button was pressed. The value returned with be either "back", "success", "cancel" or "error". (See the InstallOptions docs for more info.)

In addition, if the user presses cancel, then the .onUserAbort function would be executed. If you call "abort" in that function, the cancel will be aborted. (This would be a way for you to intercept the user's cancel request, if desired.)