In my solution, I use these showFormInDialog boxes to prompt for badge ID entry. However, i don’t want the user to just click the “X” on the upper right hand corner and just close the dialog box. How do i force them NOT to close that window using the “X”?
I tried the onHide trigger but that will trigger everytime the form is not in display.
I’m not sure I understand. I don’t have a “close” button. But when you do a formInDialog, users can press that “X” on the upper right hand corner to close out that dialog box. I need a way to stop the users from just clicking on that button.
There isn’t a “onClose” method for Forms is there? I’m just not sure how I would even trigger this script to run. I need it triggered when the user tries to press the “X” close window Windows button on the upper right hand corner of the dialog box.
in an onhide method of a form that is shown in the dialog!!
you should just return true or false.
don’t close the dialog because you are in closing the dialog…
I understand your warning, how ever, it does not apply to my case (see code above). The only thing i do on hide is show a debug dialog (which is shown!!!) and return false. But the screen doesn’t react to the return value…
I’ve created a small sample solution to test this problem and the problem is located somewhere else. In our real life solution we frequently use variables without prefixing them with ‘var’, for example onload of a form. This way they become globals. This comes in handy when defining globals you really don’t want to be in the list of Servoy globals or when defining global arrays. When I use such a variable things go wrong (servoy says the variable is not defined). When I use a real full blooded Servoy global variable it works fine. But the fake ‘global variables’ worked fine up untill now… Has something changed on your side?
nope. The debugger is disabled. The sample solution is enclosed here. I’ve commented out the code where i use the fake global so now it works fine. Just decomment it and see the error…