Focal Point
Maintain : Application has been disconnected .......

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/9301009331

September 22, 2005, 07:36 AM
Pete
Maintain : Application has been disconnected .......
Hi,

During the build of this Maintain Application , there is one thing that bugs me quite a lot .

Everytime is close the application,i get a warning window stating

" This Application has been disconnected from the server"

Can i get rid of it , in anyway?


Im on Maintain 5.3,by the way

Any Ideas?


Peter
September 22, 2005, 12:21 PM
Maintain Wizard
Pete
This usually happens when you click on the X on the toolbar instead of a clean exit. If you place an exit button on the form with a:

self.winexit();

command behind it, you will no longer get that error.

Mark
September 22, 2005, 02:20 PM
Pete
Mark,

the next question would then be .. how can i disable the X on the toolbar

cause you can count on it the users will click on it to close the application *smile*

is there a way to disable it

P.
September 28, 2005, 05:43 PM
Maintain Wizard
Pete
We have never come up with a good way to do this. The X is a function of the browser. We have gotten creative and made the screen wider than the size of the browser. This way, the X appears off the screen.

Mark
January 17, 2008, 02:27 PM
<San Jose Steve>
In the onLoad Javascript for your form add the following bolded code.

var OriginalOnload = document.body.onload;
document.body.onload = LoadFunct;
window.onunload = unLoadMaintain;
function LoadFunct() {
if (OriginalOnload) OriginalOnload ();
}

function unLoadMaintain(){
OnbtnExit_Click();
}



Add a button to the form and name it btnExit. Add the “self.WinExit()” code from the close project button.

Case OnbtnExit_Click
self.WinExit();
EndCase


When the red X of the window is clicked, the unLoadMaintain function is called, unloading maintain and disconnecting from the server.

Good luck

Steve
January 17, 2008, 02:50 PM
Alan B
I believe that you can also add

MNTCON EXIT_WARNING OFF

in EDASPROF.PRF (or user profile) to get rid of the message.


Alan.
WF 7.705/8.007
January 17, 2008, 03:37 PM
<San Jose Steve>
That's true, however it can leave an agent hanging on the server.
January 17, 2008, 06:45 PM
Alan B
Cannot remember what happens in the 5.n releases now, but in 7.6 the agent will not hang, but will move to an idle state even if the browser is closed incorrectly when in a Maintain.

4.n releases will leave the agent hanging.

I believe that Maintain is pretty robust now and many of the older issues no longer apply. It is also difficult to intercept the generated js, and I now do not attempt to do that.

The one thing I did find was that by adding a further window.onload caused the generated window.onload to fail, and suspect adding another window.onunload may have the same effect, it may be better to use a window.onbeforeunload to save any issues with js processing if you want to go down that road.


Alan.
WF 7.705/8.007
January 29, 2008, 09:03 AM
John_Edwards
In the Top case of your Maintain file --

   Sys_mgr.focset("maintain_warning", "off")