ITabEventResponse
This object returns the response of the TabOpen 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;
getType
Use this function to get type from the TabOpen event subscription response. The type shows the type of newly opened tab as browser tab, MSI tab or MSI sub tab.
Here's the
syntax:
getType(): string;
The following code sample shows an example in Typescript for for subscribing to
TabOpen
event.
/// <reference path="uiEventsFramework.d.ts"/>
const frameworkProvider: IUiEventsFrameworkProvider = await CX_SVC_UI_EVENTS_FRAMEWORK.uiEventsFramework.initialize('MyFirstExtensionID''v1');
const globalContext: IGlobalContext = await frameworkProvider.getGlobalContext();
const payload: IEventRequest = frameworkProvider.requestHelper.createSubscriptionRequest('cxEventBusTabOpenEvent');
globalContext.subscribe(payload, (response: IEventResponse) => {
const tabOpenResponse = response as ITabEventResponse;
const tabContext: ITabContext = tabOpenResponse.getResponseData();
const type: string = tabOpenResponse.getType();
})
The following code sample shows an example in JavaScript for for subscribing to TabOpen event.
const frameworkProvider = await CX_SVC_UI_EVENTS_FRAMEWORK.uiEventsFramework.initialize('MyFirstExtensionID''v1');
const globalContext = await getGlobalContext();
const payload = frameworkProvider.requestHelper.createSubscriptionRequest('cxEventBusTabOpenEvent');
globalContext.subscribe(payload, (response) => {
const tabContext = response.getResponseData();
const type = tabOpenResponse.getType();
})