ITabCloseEventResponse
This object returns the response of the TabClose event subscription.
Functions
getResponseData
Use this function to get Response data from the TabOpen event subscription response.
Here's the
syntax:
getResponseData(): ITabContext;
getEventName
Use this function to get event name data from the TabOpen event subscription response.
Here's the
syntax:
getEventName(): string;
getContext
Use this function to get event name data from the TabOpen event subscription response.
Here's the
syntax:
getEventName(): string;
The following code sample shows an example in Typescript for subscribing to TabClose
event.
const subscribeTabClose = async () => {
const frameworkProvider: IUiEventsFrameworkProvider = await CX_SVC_UI_EVENTS_FRAMEWORK.uiEventsFramework.initialize('appname', 'v1');
const globalContext: IGlobalContext = await frameworkProvider.getGlobalContext();
const payload: IEventRequest = frameworkProvider.requestHelper.createSubscriptionRequest('cxEventBusTabCloseEvent');
globalContext.subscribe(payload, (response: IEventResponse) => {
let responseData = response as ITabCloseEventResponse;
console.log(responseData.getResponseData().getTabId()); // Close Tab's tab information
console.log(responseData.getEventName()); // 'cxEventBusTabCloseEvent'
console.log(responseData.getContext()); // contextObject info
});
}
The following code sample shows an example in JavaScript for subscribing to TabClose event.
const subscribeTabClose = async () => {
const frameworkProvider = await CX_SVC_UI_EVENTS_FRAMEWORK.uiEventsFramework.initialize('appname', 'v1');
const globalContext = await frameworkProvider.getGlobalContext();
const payload = frameworkProvider.requestHelper.createSubscriptionRequest('cxEventBusTabCloseEvent');
globalContext.subscribe(payload, (responseData) => {
console.log(responseData.getResponseData()); // Closed Tab's tab information
console.log(responseData.getEventName()); // 'cxEventBusTabCloseEvent'
console.log(responseData.getContext()); // contextObject info
});
}