Newer Version Available

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

setTabTitle()

Usage

Sets the title of a primary tab or subtab. This method is only available in API version 20.0 or later.

Syntax

1sforce.console.setTabTitle(tabTitle:String, (optional)tabID:String)

Arguments

Name Type Description
tabTitle string Title of a primary tab or subtab.
tabId string The ID of the tab in which to set the title.

This argument is only available in API version 25.0 or later.

Sample Code–Visualforce API Version 20.0 or Later

1swfobject.registerObject("clippy.codeblock-1", "9");<apex:page standardController="Case">
2    <A HREF="#" onClick="testSetTabTitle();return false">
3         Click here to change this tab's title</A> 
4
5    <apex:includeScript value="/support/console/20.0/integration.js"/>
6    <script type="text/javascript">
7        function testSetTabTitle() {
8            //Set the current tab's title
9            sforce.console.setTabTitle('My New Title');
10        }
11    </script>
12</apex:page>

This example is set to run by clicking a custom link on a case. For more information, see “Defining Custom Buttons and Links” in the Salesforce online help.

Note

Response

None

Sample Code–Visualforce API Version 25.0 or Later

1swfobject.registerObject("clippy.codeblock-2", "9");<apex:page>
2    <A HREF="#" onClick="testSetTabTitle();return false">
3         Click here to change the title of the focused primary tab</A> 
4
5    <apex:includeScript value="/support/console/25.0/integration.js"/>
6    <script type="text/javascript">
7        sforce.console.getFocusedPrimaryTabId(function(result){
8               sforce.console.setTabTitle('My New Title', result.id);
9        });
10    </script>
11</apex:page>

This example is only set to run if the Visualforce page is inside an application-level custom component. For more information, see Methods for Application-Level Custom Console Components.

Note

Response

None