I have a FormInDialogue with a single “Confirm” button which I’d like to force the user to deal with. I don’t want them clicking the close button.
I’ve created an onHide method.
plugins.dialogs.showErrorDialog('Error','<html>Please complete the information for the personnel records
and use the Confirm button to close this dialogue.')
return false;
This does the trick. However it also activates when the user clicks the Confirm button. I’ve tried adding
Create a global variable called ‘gFlag’ which is type number
Modify your ‘Confirm’ method as follows :
globals.gFlag = 1
//the rest of your confirm method as is
Modify your onHide method as follows :
if ( globals.gFlag != 1 )
{
plugins.dialogs.showErrorDialog('Error','<html>Please complete the information for the personnel records
and use the Confirm button to close this dialogue.')
return false;
}
else
{
globals.gFlag = null
}
When the user clicks the confirm button then the flag will be set to ‘1’ and the onHide method will pass over the error dialogue and then reset itself to null
If the user clicks on the close box then the flag is null and the onHide method error dialogue will trigger