refreshSubtabById()
指定された ID で最後に確認された URL を持つサブタブを更新します。最後に確認された URL が外部ページまたは Visualforce ページの場合、このメソッドではサブタブを更新できません。このメソッドは、API バージョン 22.0 以降でのみ使用できます。
構文
1sforce.console.refreshSubtabById(id:String, active:Boolean, (optional)callback:Function)引数
| 名前 | 型 | 説明 |
|---|---|---|
| id | string | 更新するサブタブの ID。 |
| active | boolean | true の場合、更新されたサブタブがすぐに表示されます。false の場合、更新されたサブタブがバックグラウンドで表示されます。 |
| callback | function | メソッドの完了時にコールされる JavaScript メソッド。 |
サンプルコード – Visualforce
1swfobject.registerObject("clippy.codeblock-1", "9");
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17<apex:page standardController="Case">
18
19 <A HREF="#" onClick="testRefreshSubtabById();return false">
20 Click here to refresh a subtab by id</A>
21
22 <apex:includeScript value="/support/console/22.0/integration.js"/>
23 <script type="text/javascript">
24 function testRefreshSubtabById() {
25 //Set the name of the tab by using the openSubtab method
26 //This value is for example purposes only
27 var subtabId = 'scc-st-0';
28 sforce.console.refreshSubtabById(subtabId, true, refreshSuccess);
29 }
30
31 var refreshSuccess = function refreshSuccess(result) {
32 //Report whether refreshing the subtab was successful
33 if (result.success == true) {
34 alert('Subtab refreshed successfully');
35 } else {
36 alert('Subtab did not refresh');
37 }
38 };
39
40 </script>
41
42</apex:page>応答
このメソッドは非同期であるため、コールバックメソッドのオブジェクトで応答を返します。応答オブジェクトには次の項目が含まれます。
| 名前 | 型 | 説明 |
|---|---|---|
| success | boolean | サブタブが正常に更新された場合は true、サブタブが更新されなかった場合は false。 |