Close Window - Forum

Forum Navigation
You need to log in to create posts and topics.

Close Window

Hola,

Teniendo una apliación VisualNeo  con varias páginas ¿cómo puedo cerrar la apliación desde la última página?

He probado dos opciones:

1.- Con VisualNeo:  Exit

2.- Con javascript

BeginJS
window.close()
EndJS

Pero solo funcionan en la primera página. No logro que cierrre la apliacación.

Saludos,

 

Roger

 

 

 

 

 

 

 

@rrey:

But they only work on the first page. I can't get the app to close.

If all else fails, you might consider invoking a subroutine (from the other pages) that does ...

SetVar "[ExitFlag]" "Yes"
GotoPage "Home"

... and in the PageEnter section of the first page ...

If "[ExitFlag]" "==" "Yes"
... you exit code goes here
EndIf

 

Hola @gaev,

Este código   ya lo probé al principio de todo pero no funciona.

Gracias.

 

@rrey

Sorry, I missed your earlier response.

I did some more experimentation ... I placed a PushButton on the first page with the window. close () code in it ... I found that the button worked ONLY when I did NOT navigate to another page before clicking on it ... if I navigated to the next page, then back to the first page, the Push Button did not do anything ... when I inspect the page, the Console Log says ...

Scripts may close only the windows that were opened by them.

I found some more information about this command ...

The Window. close() method closes the current window, or the window on which it was called. This method can only be called on windows that were opened by a script using the Window. open() method.

You can close the current window using self.close (); For example:
<a href="self.close ()">Close this Window</a>

So, I tried placing this html in a Container ... and it worked !!! ... but, in Chrome, when the app is closed, it does not close the Tab ... instead, it shows a weird message ...

Your file was not found
It may have been moved or deleted.
ERR_FILE_NOT_FOUND

... which may confuse the user.