Tag change open a popup in Perspective?

Ignition Version : 8.1.24 Perspective

I add a project Library.

# messageBox def messageBox(title,message,sessionId=None,pageId=None): system.perspective.openPopup("messageBox",'Popup/messageBox', title=title,params = {'message':message}, showCloseIcon = True, resizable = True,modal=True,sessionId=sessionId, pageId=pageId)

I have a tag , when it change from False to True, show a messageBox in Perspectvie.

I try on btn to show messgebox , It's ok.

I try on Gateway - Tag change script, it can't show.

I try on Tag - Value change script , it can't show.

How to show in Perspective?

As @pturmel said in this thread

The most convenient place to do this is in a shared docked view for the entire project. The change event on one of its custom properties, bound to the tag, will have the context needed to unconditionally open a popup.

In Version 8.1.24:

I try left menu add a custom property,bind to a tag;

I add change script in it.

But the popup also can't show .

def valueChanged(self, previousValue, currentValue, origin, missedEvents):
        if previousValue is None:
            return
        # 只在False→True上升沿弹窗
        system.perspective.print('valueChanged.....')
        # 8.1.24 必须手动从self提取sessionId和pageId,否则sendMessage丢失上下文
        sessionId = self.session.props.id
        system.perspective.print(str(sessionId))
        pageId = self.page.props.pageId
        system.perspective.print(str(pageId))
        if previousValue.value == False and currentValue.value == True:
            system.perspective.print('false----true')
            projectDef.messageBox(u'tip', u'msg',sessionId=sessionId,pageId=pageId)

Do not provide session ID or page ID when opening a popup from within a page context. (Also, show us the real call to system.perspective.openPopup(), not just a call to a library function that is "understood" to do it for you.)

I just did it this way on a project. I'm glad to hear that is considered a good way to do it :slight_smile:

I am biased toward UI tag bindings rather than messaging. Script in one place instead of two, and the "send" side is handled purely in java infrastructure.