FormInDialog onHide

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

return true;
forms.securityAdmin.controller.show();

as the final steps of the “Confirm” method. Doesn’t work.

The problem might be solved if I gave the “onHide” method a conditional that the Confirm button wasn’t being activated. Any ideas?

Hi Morley,

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

Hope this helps

Harry

or - my favourite: use a transaction.

patrick:
or - my favourite: use a transaction.

?? Please explain, that was too terse for this new user.

In the meantime, Harry’s approach works.