Tab Replaced

lightning:tabReplaced

Fires when a Console primary tab or subtab has been successfully replaced, such as when saving a new record and the create form is replaced with the newly created Record Home.

For Use In

Lightning Experience

::::::tabset{tabs='[ "Develop", "Specifications"]'}

:::::tab

lightning:tabReplaced is an application event that indicates a tab has been replaced successfully. This event is supported in Lightning console apps only.

Handle the event using aura:handler.

<aura:component implements="flexipage:availableForAllPageTypes" access="global">
  <lightning:workspaceAPI aura:id="workspace" />
  <aura:handler event="lightning:tabReplaced" action="{! c.onTabReplaced }" />
</aura:component>

In your client-side controller, retrieve the ID of the replaced tab.

({
    onTabReplaced : function(component, event, helper) {
        var replacedTabId = event.getParam("tabId");
        var workspaceAPI = component.find("workspace");
        workspaceAPI.getTabURL({
            tabId : replacedTabId;
            callback : function(error, response){
                console.log(response);
            }
        });
    }
})

For more information, see the Salesforce Console Developer Guide.

:::::

:::::tab

Attributes

Name Description Type Default Required
tabId The ID of the refreshed tab. string Yes

:::::

::::::