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