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