The open_full_view message is sent from the parent container (myzPAX) to the embedded app (iframe). It notifies the embedded app that myzPAX wants to open the app in full view mode. The embedded app must listen for this message, perform any necessary initialization actions, and respond with sendZpaxMessage('open_full_view', ...) to confirm navigation.
The embedded app must respond within 1 second of receiving this message. If it does not, myzPAX will automatically navigate to full view using default configurations as a fallback. To cancel the navigation, respond with
cancel: truevia theopen_full_viewrequest message.
Message Type
type messageType = 'open_full_view';Payload
type Payload = {
viewId: string; // Identifier of the view making the request
};The payload contains a viewId string that identifies the source view. It is derived from the view's title with spaces replaced by -, and suffixed with ^<type_of_the_view>.
For example, a tile view titled PDPM Rate Simulator produces the viewId: PDPM-Rate-Simulator^tile_view.
When It Is Sent
myzPAX sends this message:
- When it initiates navigation to open the embedded app in full view mode.
Example
const unsubscribe = addZpaxMessageListener('open_full_view', (message) => {
if (message.data.viewId === 'PDPM-Rate-Simulator^tile_view') {
const conditionsMetForFullViewNavigation: boolean = // cancellation logic
// Must respond within 1 second or fallback will be triggered
if (conditionsMetForFullViewNavigation) {
sendZpaxMessage('open_full_view', {
state: `/home?navigatedFrom=${message.data.viewId}`,
});
} else {
sendZpaxMessage('open_full_view', { cancel: true });
}
}
});Use Cases
- To perform pre-navigation actions before transitioning to full view, such as saving tile state to
localStorage. - To conditionally cancel the full view navigation based on app-specific logic.
Related
open_full_viewrequest message — The message the embedded app sends in response to confirm or cancel navigation.addZpaxMessageListener— Function used to subscribe to incoming messages.sendZpaxMessage— Function used to send messages to myzPAX.