IEventRequest
IEventRequest uses the getEventName function.
The function gets the event name from an event request object created.
The following code sample shows the syntax for
getEventName.
getEventName(): string;
The following code sample shows an example in
Typescript:
/// <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 requestObject: IEventRequest = frameworkProvider.requestHelper.createSubscriptionRequest('cxEventBusTabOpenEvent');
globalContext.subscribe(requestObject: IEventRequest,(response: IEventResponse) => {
// custom code
});
const eventName: string = requestObject.getEventName(); // 'cxEventBusTabOpenEvent'
The following code sample shows an example in
Javascript:
const frameworkProvider = await CX_SVC_UI_EVENTS_FRAMEWORK.uiEventsFramework.initialize('MyFirstExtensionID''v1');
const globalContext = await frameworkProvider.getGlobalContext();
const requestObject = frameworkProvider.requestHelper.createSubscriptionRequest('cxEventBusTabOpenEvent');
globalContext.subscribe(requestObject,(response) => {
// custom code
});
const eventName = requestObject.getEventName(); // 'cxEventBusTabOpenEvent'