How to restrict from closing main Window

Find out how to get things done with Servoy. Post how YOU get things done with Servoy

How to restrict from closing main Window

Postby hardina09 » Thu Mar 07, 2013 4:39 pm

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
hardina09
 
Posts: 62
Joined: Tue Apr 24, 2012 9:46 pm

Re: How to restrict from closing main Window

Postby ngervasi » Thu Mar 07, 2013 5:22 pm

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).
Nicola Gervasi
sintpro.com
SAN Partner
ngervasi
 
Posts: 1485
Joined: Tue Dec 21, 2004 12:47 pm
Location: Arezzo, Italy

Re: How to restrict from closing main Window

Postby hardina09 » Thu Mar 07, 2013 6:46 pm

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.
hardina09
 
Posts: 62
Joined: Tue Apr 24, 2012 9:46 pm

Re: How to restrict from closing main Window

Postby ngervasi » Thu Mar 07, 2013 7:24 pm

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.
Nicola Gervasi
sintpro.com
SAN Partner
ngervasi
 
Posts: 1485
Joined: Tue Dec 21, 2004 12:47 pm
Location: Arezzo, Italy


Return to How To

Who is online

Users browsing this forum: No registered users and 7 guests

cron