Tech blog to share information.

June 16, 2018

Lightning Console Apps - 'Lightning Component Tab' Labels Display as “Loading…”

June 16, 2018 Posted by tj cool , , No comments

Lightning Console Apps


Lightning console apps help to view multiple records and their related records on the same screen, and quickly work through records from a list using the split view. This Saves lots of time. Creating custom tab in the console is also possible. But there is weird behavior with custom tabs.

If you are working on Lightning console and using the Lightning component as a custom tab in Service Console, the content loads fine but tab label stays on "Loading..." forever.

If you have faced this issue, here's the quick workaround.

1. Put this line in your component.
 //in markup

 <lightning:workspaceAPI aura:id="workspace"/>

2. Add a render event handler to your component's markup.
<aura:handler action="{!c.onRender}" name="render" value="{!this}"></aura:handler>

3. Add below code in action ("onRender") or you can also put the code in init handler
        
        var workspaceAPI = component.find("workspace");
        workspaceAPI.getFocusedTabInfo().then(function(response) {
         var focusedTabId = response.tabId;
         workspaceAPI.setTabLabel({
          tabId: focusedTabId,
          label: "Edit Contact" //set label you want to set
         });
         workspaceAPI.setTabIcon({
          tabId: focusedTabId,
          icon: "utility:add_contact", //set iconyou want to set
          iconAlt: "Edit Contact" //set label tooltip you want to set
         });
        })


0 comments: