1

I have custom console application with my own VF page.

Once I clicked the Refresh Tab, the tab is been selected (focusedTabChanged event is been called) but the tab is not refreshed.

Maybe I need to listen to refresh tab event?

Tab Menu

<apex:page standardController="Case"
  standardStylesheets="false"
  sidebar="false"
  extensions="CaseFieldExtension"
  showQuickActionVfHeader="true"
  showHeader="false"
  applyBodyTag="false"
  applyHtmlTag="true"
  docType="html-5.0"
  cache="true">

  <apex:composition template="GenericTemplate">
    <apex:define name="head">
      <apex:insert name="afterHead"></apex:insert>
    </apex:define>
    <apex:define name="body">

      <script>

      var focusListener = function (result) {
        var recievedId = result.message || result.id;
        window.focusedTabChanged && window.focusedTabChanged(recievedId);
      }

      var unFocusIfNeeded = function (result) {
        if (result.ids.length === 1){
          window.focusedTabChanged && window.focusedTabChanged();
        }
      }

      var closeTabListener = function (result) {
        sforce.console.getPrimaryTabIds(unFocusIfNeeded);
      }


      var refreshTab = function (result) {
          var recievedId = result.message || result.id;
          windowsforce.console.refreshNavigationTab();
      }
      if(window.sforce) {

        window.sforce.console.addEventListener('focusedTabChanged', focusListener);
        window.sforce.console.addEventListener(sforce.console.ConsoleEvent.CLOSE_TAB, closeTabListener);
        window.sforce.console.getFocusedPrimaryTabObjectId(focusListener);
        window.sforce.console.addEventListener(sforce.console.ConsoleEvent.REFRESH_TAB, refreshTab);

      }
      </script>
      <apex:insert name="afterBody"></apex:insert>
    </apex:define>
  </apex:composition>
</apex:page>

refreshTab function - is not been called

  • Can you post your code what you have tried so far – Santanu Boral May 3 '18 at 8:47
  • I posted my code – Ohad May 3 '18 at 9:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.