Skip to main content
Version: 8.1

system.perspective.togglePopup

This function is used in Python Scripting.

Description​

Toggles a popup view. Will open up the popup if it has not been opened yet. Otherwise, it will close the currently opened popup.

Syntax​

system.perspective.togglePopup(id, view, [params], [title], [position], [showCloseIcon], [draggable], [resizable], [modal], [overlayDismiss], [sessionId], [pageId], [viewportBound])

Parameters​

TypeParameterDescription
StringidA unique popup string. Will be used to close the popup from other popup or script actions.
StringviewThe path to the view to use in the popup.
Dictionary[String, Any]params - Dictionary of key-value pairs to us as input parameters to the View. [optional]
StringtitleText to display in the title bar. Defaults to an empty string. [optional]
Dictionary[String, Integer]positionDictionary of key-value pairs to use for position. Possible position keys are: left, top, right, bottom, width, height. Defaults to the center of the window. [optional]
BooleanshowCloseIconWill show the close icon if True. Defaults to True. [optional]
BooleandraggableWill allow the popup to be dragged if True. Defaults to True. [optional]
BooleanresizableWill allow the popup to be resized if True. Defaults to False. [optional]
BooleanmodalWill make the popup modal if True. A modal popup is the only view the user can interact with. Defaults to False. [optional]
BooleanoverlayDismissWill allow the user to dismiss and close a modal popup by clicking outside of it if True. Defaults to False. [optional]
StringsessionIdIdentifier of the Session to target. If omitted, the current Session will be used automatically. When targeting a different session, then the pageId parameter must be included in the call. [optional]
StringpageIdIdentifier of the page to target. If omitted, the current Page will be used automatically. [optional]
BooleanviewportBound​
New in 8.1.3
If True, popups will be "shifted" to open within the bounds of the viewport. If the popup would be larger than the viewport, then it will be resized to fit within the bounds. Default is False. [optional]

Returns​

Nothing

Scope​

Gateway, Perspective Session

note

This function will only work in the Gateway scope if both sessionId and pageId are supplied to the call.

Code Examples​

Code Snippet - View
# Toggles a popup view. We are passing in two parameters, called "myParam" and "myParam2".
system.perspective.togglePopup("myPopupId",'folder/myView', params = {"myParam":1,"myParam2":"Test"})