Skip to main content
insightsoftware Documentation insightsoftware Documentation
{%article.title%}
Published:
Was this article helpful?
0 out of 0 found this helpful

OnClose

Use this command to specify the procedure to run after a user clicks the window close button (the x in the top right of the window’s title bar) in the main window of a Longview Data Grid or HTML window of a Longview App. OnClose behavior does not apply to subwindows.

After the procedure runs, the application terminates unless a called procedure includes the CancelClose command. For more information, see CancelClose.

If you do not specify OnClose behavior, the window close button is disabled. The window close button is also disabled whenever Longview Application Framework is running. For example, the close button is disabled when any Longview Application Framework processes execute as a result of the following in a Data View:

  • toolbar actions
  • context-sensitive actions
  • dynamic models
  • the onBlur and onFocus parameters when a user switches tabs

If the OnClose procedure contains an error, and OnError behavior is set to RETURN, TERMINATE, or CONTINUE, the following actions occur:

  • the error is written to an error file
  • the procedure specified by the OnError command runs (if applicable)
  • an error message appears
  • the process terminates

If no OnError behavior is specified, an error message appears and then the process is terminated.

Syntax:

ONCLOSE "[FolderPath\]Proc.lvpro"

where:

  • FolderPath is relative to the working directory. You do not need to specify a file path if the procedure resides in the lvaf directory.
  • Proc is the name of the procedure to run.

Syntax example:

ONCLOSE "Proc.lvpro"

Published:

OnClose

Use this command to specify the procedure to run after a user clicks the window close button (the x in the top right of the window’s title bar) in the main window of a Longview Data Grid or HTML window of a Longview App. OnClose behavior does not apply to subwindows.

After the procedure runs, the application terminates unless a called procedure includes the CancelClose command. For more information, see CancelClose.

If you do not specify OnClose behavior, the window close button is disabled. The window close button is also disabled whenever Longview Application Framework is running. For example, the close button is disabled when any Longview Application Framework processes execute as a result of the following in a Data View:

  • toolbar actions
  • context-sensitive actions
  • dynamic models
  • the onBlur and onFocus parameters when a user switches tabs

If the OnClose procedure contains an error, and OnError behavior is set to RETURN, TERMINATE, or CONTINUE, the following actions occur:

  • the error is written to an error file
  • the procedure specified by the OnError command runs (if applicable)
  • an error message appears
  • the process terminates

If no OnError behavior is specified, an error message appears and then the process is terminated.

Syntax:

ONCLOSE "[FolderPath\]Proc.lvpro"

where:

  • FolderPath is relative to the working directory. You do not need to specify a file path if the procedure resides in the lvaf directory.
  • Proc is the name of the procedure to run.

Syntax example:

ONCLOSE "Proc.lvpro"

For an optimal Community experience, Please view on Desktop