system.perspective.openPopup
This function is used in Python Scripting.
Description​
Open a popup view over the given page.
Syntax​
system.perspective.openPopup(id, view, [params], [title], [position], [showCloseIcon], [draggable], [resizable], [modal], [overlayDismiss], [sessionId], [pageId], [viewportBound])
Parameters​
Type | Parameter | Description |
---|---|---|
String | id | A unique popup string. Will be used to close the popup from other popup or script actions. |
String | view | The path to the View to use in the popup. |
Dictionary[String, Any] | params | Dictionary of key-value pairs to use as input parameters to the View. [optional] |
String | title | Text to display in the title bar. Defaults to an empty string. [optional] |
Dictionary[String, Integer] | position | Dictionary 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] |
Boolean | showCloseIcon | Shows the close icon if True. Defaults to True. [optional] |
Boolean | draggable | Allows the popup to be dragged if True. Defaults to True. [optional] |
Boolean | resizable | Allows the popup to be resized if True. Defaults to False. [optional] |
Boolean | modal | Makes the popup modal if True. A modal popup is the only view the user can interact with. Defaults to False. [optional] |
Boolean | overlayDismiss | Allows the user to dismiss and close a modal popup by clicking outside of it if True. Defaults to False.[optional] |
String | sessionId | Identifier of the Session to target. If omitted, the current Session will be used automatically. [optional] |
String | pageId | Identifier of the Page to target. If omitted, the current Page will be used automatically. When targeting a different session, then this parameter must be included in the call. [optional] |
Boolean | viewportBound | ​ New in 8.1.3 If True, popups will be "shifted" to always 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
# Opens a popup view. We are passing in two parameters, called "myParam" and "myParam2". We also set some additional properties of the popup.
system.perspective.openPopup("myPopupId",'folder/myView', params = {'myParam':1,'myParam2':'Test'}, showCloseIcon = False, resizable = True)
Code Snippet
# Opens a popup view. The top left corner of the popup will be 100 pixels from the left and top edges of the session.
system.perspective.openPopup('myPopupId', 'folder/myView', position = {'left':100,'top':100})