Newer Version Available

This content describes an older version of this product. View Latest

lightning:tabRefreshed

Indicates that a tab has been refreshed.

Response

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

Example

This example prints a line to the browser’s developer console when a tab is refreshed, and then returns that tab’s tabInfo object using the getTabInfo() method.

Component code:

1<aura:component implements="flexipage:availableForAllPageTypes" access="global" >
2    <lightning:workspaceAPI aura:id="workspace" />	
3    <aura:handler event="lightning:tabRefreshed" action="{! c.onTabRefreshed }"/> 
4</aura:component>

Controller code:

1({
2       onTabRefreshed : function(component, event, helper) {
3           console.log("Tab Refreshed");
4           var refreshedTabId = event.getParam("tabId");
5           var workspaceAPI = component.find("workspace");
6           workspaceAPI.getTabInfo({
7                tabId : refreshedTabId
8           }).then(function(response) {
9                console.log(response);    
10           });
11       }
12    })