Skip to main content
Version: 8.1

system.nav.swapWindow

This function is used in Python Scripting.

Description

Performs a window swap. This means that one window is closed, and another is opened and takes its place - assuming its size, floating state, and maximization state. This gives a seamless transition - one window seems to simply turn into another.

This function works like system.nav.swapTo, except that you can specify the source and destination for the swap.

Client Permission Restrictions

This scripting function has no Client Permission restrictions.

Syntax #1 (String param)

system.nav.swapWindow(swapFromPath, swapToPath, [params])

Parameters

TypeParameterDescription
StringswapFromPathThe path of the window to swap from. Must be a currently open window, otherwise this will act like an openWindow.
StringswapToPathThe name of the window to swap to.
Dictionary[String, Any]paramsA dictionary of parameters to pass into the window. The keys in the dictionary must match dynamic property names on the target window's root container. The values for each key will be used to set those properties. [optional]

Returns

Window - A reference to the swapped-to window.

Scope

Vision Client

Syntax #2 (EventObject param)

system.nav.swapWindow(event, swapToPath, [params])

Parameters

TypeParameterDescription
EventObjecteventA component event whose enclosing window will be used as the "swap-from" window.
StringswapToPathThe name of the window to swap to.
Dictionary[String, Any]paramsA dictionary of parameters to pass into the window. The keys in the dictionary must match dynamic property names on the target window's root container. The values for each key will be used to set those properties. [optional]

Returns

Window - A reference to window that was navigated to. Refer to the list of window objects.

Scope

Vision Client

Code Examples

Example #1
# This code would go in a button's ActionPerformed event to swap out of the
# window containing the button and into a window named MyWindow.
system.nav.swapWindow(event, "MyWindow")
Example #2
# This code would swap from window named WindowA to a window named WindowB.
system.nav.swapWindow("WindowA", "WindowB")
Example #3
# This code would swap from window named WindowA to a window named WindowB.
# It also looks at the two calendar popup controls and passes the two selected
# dates to WindowB. WindowB's Root Container must have dynamic properties named
# "startDate" and "endDate".
date1 = event.source.parent.getComponent("Start Date").date
date2 = event.source.parent.getComponent("End Date").date
system.nav.swapWindow("WindowA", "WindowB", {"startDate":date1, "endDate":date2})

Keywords

system nav swapWindow, nav.swapWindow