self.page.props.pageId not resolving correctly?

Afternoon

We have noticed that since updating to V8.0.13, any popup using “self.page.props.pageId” seems to resolve to “1af10a27” rather than the passed id.

Is this known or just us?

Are you in the Designer? The Designer has absolutely no concept of “Page” because you only ever see Views. In the Designer, references to the pageId property from anywhere result in a reference to the Designer. Active Sessions do return the correct Page ID associated with the open tab.

While attempting to replicate this, I tried the following setup:
On a View whihc is the primary View in use for a Page, I placed a Button component with the following code in a Script Action tied to an onClick Event:

system.perspective.togglePopup(id='A',view='Experimentation/Repl',params={id:self.page.props.pageId})

The id param is used by a secondary View which has a param with a key of id and a Label whose text is bound to self.view.params.id (and also an Icon)

After clicking my button, I encountered the following expected behavior in an active Session:
Screen Shot 2020-06-15 at 10.50.18 AM

Thanks for your response, I understand

Prior to version 8.0.13 we have been successfully using the following to close popups

popupID = self.page.props.pageId

system.perspective.closePopup(popupID)

This seems to be an incorrect usage, confusing pageId with the popup id,

I guess we have just been fortunate until now.

Ah, okay, so the likely cause for what you’re encountering is a fix that went into 8.0.13.

Before 8.0.13, if closePopup or togglePopup was supplied an id argument which didn’t match any open popup, then Perspective closed the most recently focused Popup. In the event self.page.props.pageId did not match the id of the popup you had open, but that popup was the most recently focused popup, it still would have been closed.

Many users limped along on this bug without realizing it because most users only have one popup open at a time. For users who have more than one popup, this behavior was wreaking havoc with their projects.

8.0.13 has changed this behavior so that if the supplied id is not found no action is taken. We also realize that some uses prefer the option to perform a sort of “blind” close operation, and so if an empty string is supplied for the `id arg, then the old behavior is used.

You can probably get back to your previous behavior by changing your close operation to the following:

system.perspective.closePopup("")

OK, thanks for the clarification.