0

I am trying to open a primary via this:

sforce.console.openPrimaryTab(null, '/lightning/n/***', true, 'TestSearch', openSuccess, 'salesforceTab');

Now if I pass false, the tab opens and does not gets focus, but is there a way to make the unfocused tab blink?

Also can we open more than one primary tab?

Update

When we try to move to lightning, we have an api for tab creation, and there is a method which highlights the tab.

onTabCreated : function(objComponent, objEvent) {
    let strTabId = objEvent.getParam('tabId');
    let objWorkspaceAPI = objComponent.find("workspace");
    objWorkspaceAPI.setTabHighlighted({
        tabId: strTabId,
        highlighted: true,
        options: {
            pulse: true,
            type: "success"
        }
    });
}

Using this I can highlight the tab, but only a red mark comes up on the tab and also the pulse option does not work as it is defined in the documentation? Is this the correct way to use the pulse.?

  • 1
    That sounds horrible. – Adrian Larson Jan 17 at 13:14
  • By blink I mean the title of it. Not the complete tab. – Nagendra K S Jan 17 at 14:21
0

I did this using the setTabHighlighted method and triggering it via setInterval method:

Helper:

startShowingText: function (workspaceAPI) {
    workspaceAPI.getFocusedTabInfo().then(function (response) {
        var focusedTabId = response.tabId;
        workspaceAPI.setTabHighlighted({
            tabId: focusedTabId,
            highlighted: true,
            options: {
                pulse: true,
                type: "success"
            }
        }).then(function (objPageInfo) {
            workspaceAPI.setTabLabel({
                tabId: objPageInfo.tabId,
                label: 'Test1'
            })
        });
    })
},

stopShowingText: function (workspaceAPI) {
    workspaceAPI.getFocusedTabInfo().then(function (response) {
        var focusedTabId = response.tabId;
        workspaceAPI.setTabHighlighted({
            tabId: focusedTabId,
            highlighted: false,
            options: {
                pulse: true,
                type: "success"
            }
        }).then(function (objPageInfo) {
            workspaceAPI.setTabLabel({
                tabId: objPageInfo.tabId,
                label: ' '
            })
        });
    })
}

Controller :

    var counter = 1;
    setInterval(function() {
        if (counter++ % 2) {
            helper.startShowingText(workspaceAPI);
        } else {
            helper.stopShowingText(workspaceAPI);
        }
    }, 2000);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.