tamaki.mes.utils.openModal
Description
Opens a modal Perspective popup. A random UUID is generated and passed to the popup view as the
popupId parameter (and popupType is set to 'popup'), so the popup view must accept at least a
popupId parameter plus whatever you pass in params. The popup is opened modal, resizable,
draggable, viewport-bound, and dismissible by clicking the overlay.
Must be run in a Perspective session scope.
Syntax
tamaki.mes.utils.openModal(path, params)
Parameters
| Parameter | Type | Nullable | Description |
|---|---|---|---|
path | String | False | The path to the view used as the popup. It must accept the input parameters popupId plus params. |
params | Dict | True | The parameters to pass to the popup view. popupId does not need to be included. May be None. |
Returns
A String: the generated UUID used as the popup id (useful for closing it later).
Code Examples
# From a button's onActionPerformed event: open a popup with no extra params
tamaki.mes.utils.openModal('Header/_popups/Backup', {})
# The second argument passes input parameters to the popup view
tamaki.mes.utils.openModal('TamakiMES/Material/_popups/EditMaterial', {'materialId': materialId})