No Results
Search Tips:
- Please consider misspellings
- Try different search keywords
Newer Version Available
getPageInfo()
Usage
Returns page information for the specified tab after its content has loaded. If the tab ID is null, it returns page information for the enclosing primary tab or subtab. Note that to get the page information from a custom console component, a tabId must be passed as the first parameter to this method.This method is only available in API version 26.0 or later.
Syntax
1sforce.console.getPageInfo(tabId:String, (optional)callback:Function)Arguments
| Name | Type | Description |
|---|---|---|
| tabId | string | ID of the tab from which page information is returned. |
| callback | function | JavaScript method called upon completion of the method. |
Sample Code–Visualforce
1swfobject.registerObject("clippy.codeblock-1", "9");<apex:page>
2 <A HREF="#" onClick="testGetPageInfo();return false">
3 Click here to get page information</A>
4
5 <apex:includeScript value="/support/console/26.0/integration.js"/>
6 <script type="text/javascript">
7 function testGetPageInfo() {
8 //Get the page information of 'scc-pt-1'
9 //This value is for example purposes only
10 var tabId = 'scc-pt-1';
11 sforce.console.getPageInfo(tabId , showPageInfo);
12 }
13
14 var showPageInfo = function showPageInfo(result) {
15 alert('Page Info: ' + result.pageInfo);
16 };
17 </script>
18</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 fields:
| Name | Type | Description |
|---|---|---|
| pageInfo | string | The URL, and if applicable, the object ID, object name, and object type of the page. The data
is returned in JSON format. For example:
|
| callback | function | JavaScript method called upon completion of the method. |