Page 1 of 1

How to restrict from closing main Window

PostPosted: Thu Mar 07, 2013 4:39 pm
by hardina09
I went through forum regarding closing main window in servoy. Some how I not able to do so.
I developing app in Version: 6.1.3 - build 1424

In my onShow() event i am setting form level variable as false and onHide() event its returning false and I am having a button on form event I am setting form level variable as true.
Still it is not running as require.

I need to restrict user using close button on main window and it should be able close main window through code in button event.

Any suggestion is appreciated

Re: How to restrict from closing main Window

PostPosted: Thu Mar 07, 2013 5:22 pm
by ngervasi
That should be enough, just make sure that that form is loaded DIRECTLY in the controller and not inside some tabpanel. If onHide returns false the main window shouldn't close (at least it used be like this in the past).

Re: How to restrict from closing main Window

PostPosted: Thu Mar 07, 2013 6:46 pm
by hardina09
I see, what if form is opened in tabpanel. Do the onhide event works in different way than what is mentioned. Then how to controll of close of main Window from code.

Re: How to restrict from closing main Window

PostPosted: Thu Mar 07, 2013 7:24 pm
by ngervasi
When the window is closed the onHide on the form loaded in it is executed, not the one of your X form loaded in the tab panel. So you have to use the onHide event of the Main form, in there you can check if table panel Y has the X form loaded and act accordingly returning false.