Is the pageID unique?

It's true that the Popup has no way to directly refer to the "parent" page it belongs to. You should only need to specify a pageId argument if you intent to target a different page. For example, consider a session which has two pages open. You place a button which is supposed to close the other page. You would use something like this:

session_objs = system.perspective.getSessionInfo()
for session_obj in session_objs:
    if session_obj.id == self.session.props.id:
        for page_id in session_obj.pageIds:
            if page_id != self.page.props.pageId:
                system.perspective.closePage(pageId=page_id)

Where you actually what page needs to be acted on. If you do not supply the pageId, then the function acts on the current page.

3 Likes