ITabInfo

Functions

getTabId

Use this function to to get the browser tabId value from the TabClose event subscription response.

Here's the syntax:
getTabId(): string;

getMsiTabId

Use this function to get the MSI tab ID from the TabClose event subscription response.

Here's the syntax:
getMsiTabId(): string;

getMsiSubTabId

Use this function to get the MSI sub tab ID from the TabClose event subscription response.

Here's the syntax:
getMsiSubTabId(): string; 
The following code sample shows an example in Typescript for subscribing to TabClose Event where ITabInfo object is used..
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()); // Closed Tab's browser tab identifier
              console.log(responseData.getResponseData().getMsiTabId()); // Closed Tab's msi tab identifier 
              console.log(responseData.getResponseData().getMsiSubTabId()); //  Closed Tab's msi sub tab identifier      
          });
      } 
  

The following code sample shows an example in JavaScript for 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().getTabId()); // Closed Tab's browser tab identifier
              console.log(responseData.getResponseData().getMsiTabId()); // Closed Tab's msi tab identifier     
              console.log(responseData.getResponseData().getMsiSubTabId()); //  Closed Tab's msi sub tab identifier  
          });
      }