Note: This release is in preview. Features described here don’t become generally available until the latest general availability date that Salesforce announces for this release. Before then, and where features are noted as beta, pilot, or developer preview, we can’t guarantee general availability within any particular time frame or at all. Make your purchase decisions only on the basis of generally available products and features.
setTabTextStyle()
Sets a cascading style sheet (CSS) on a specified
tab’s text. If a tab is not specified, the CSS is set on the enclosing
tab’s text. Use this method to customize a tab’s text style. This method is only available in API
version 28.0 or later.
Syntax
1sforce.console. setTabTextStyle(style:String, tabID:String, (optional)callback:Function))Arguments
Sample Code–Visualforce
1<apex:page>
2 <A HREF="#" onClick="testSetTabTextStyle();return false">
3 Click here to change the enclosing tab’s text style</A> <BR/>
4 <A HREF="#" onClick="testResetTabTextStyle(); return false;">
5 Click here to reset the enclosing tab’s text style</A>
6
7 <apex:includeScript value="/support/console/68.0/integration.js"/>
8 <script type="text/javascript">
9 function checkResult(result) {
10 if (result.success) {
11 alert('Tab text style set successfully!');
12 } else {
13 alert('Tab text style cannot be set!');
14 }
15 }
16 function testSetTabTextStyle() {
17 sforce.console.setTabTextStyle('color:blue;font-style:italic;', null, checkResult);
18 }
19 function testResetTabTextStyle() {
20 sforce.console.setTabTextStyle(null, null, checkResult);
21 }
22 </script>
23</apex:page>Response
This method is asynchronous, so it returns its response in an object in a callback method. The response object contains the following field:
| Name | Type | Description |
|---|---|---|
| success | boolean | true if setting the tab’s text style was successful, false if setting the tab’s text style wasn’t successful. |