Launching a dialog
Following code launches the status dialog. Any dialog Id can be specified from the application’s XML.
from psdi.server import MXServer
from psdi.common.context import UIContext
from psdi.webclient.system.controller import SessionContext, Utility, WebClientEvent
mxServer = MXServer.getMXServer()
context = UIContext.getCurrentContext()
if context:
wcs = context.getWebClientSession()
Utility().sendEvent(WebClientEvent("status", wcs.getCurrentPageId(), None, SessionContext(wcs)))
Closing a dialog
Method # 1: The following code closes the currently open dialog by sending a dialogok event.
from psdi.common.context import UIContext
from psdi.webclient.system.controller import SessionContext, Utility, WebClientEvent
context = UIContext.getCurrentContext()
if context:
wcs = context.getWebClientSession()
Utility().sendEvent(WebClientEvent("dialogok", wcs.getCurrentPageId(), None, SessionContext(wcs)))
Method # 2: In newer versions of Maximo, the above can be achieved with a single line.
service is an implicit variable provided by the framework.
service.closeDialog()
Related:
https://community.ibm.com/community/user/iot/communities/community-home/digestviewer/viewthread?GroupId=727&MessageKey=e08bff5b-92fe-4a47-b278-a66cbc96f255&CommunityKey=3d7261ae-48f7-481d-b675-a40eb407e0fd&tab=digestviewer