0

I have an embedded VF page in the salesforce console and am trying to get the page to refresh when a user clicks a button. I have the functionality working in chrome, firefox, etc, but not in IE. Here is the VF component:

<apex:commandButton action="{!updateStatus}" onComplete="loadNext('{!myobj.id}');return false;">

and here is the JS:

<script type="text/javascript">
        var rName, rId, curTabId;
        function loadNext(recapId) {
            rName = recapName;
            rId = recapId;
            sforce.console.getEnclosingPrimaryTabId(findCurTabID);
        }


        var findCurTabID = function findCurTabID(result) {
            if (result.success == true) {
                curTabId = result.id;
                if(!rName) {
                        window.alert("There are no more un-closed records.");
                        sforce.console.closeTab(curTabId);
                } else sforce.console.openPrimaryTab(curTabId, rId , true, rName, refreshSuccess); 
            } 
        };

        var refreshSuccess = function refreshSuccess(result) {
            //Report whether refreshing the primary tab was successful
            if (result.success == true) {
                console.log('Primary tab refreshed successfully');
            } else {
                console.log('Primary did not refresh');
            }
        };
    </script>

What is the solution to get this working?

1

The reason why this wasn't working is because IE doesn't recognize the console commands unless the console is open. So i removed the console commands and all was good.

0

I have a similar problem and I found this workaround

<div id="ieBrowserFix" style="display:none;">
    <apex:sectionHeader title="IE" subtitle="BrowserFix" />
</div>

It seems that some javascript fails in IE without the sectionHeader component.

  • so i just need to wrap the button in the div? – Tyler Harrington Dec 2 '13 at 17:03
  • No I've just added the section header on the top of the visualforce page. – Alberto Maianti Dec 3 '13 at 8:26
  • @TylerHarrington have you resolved the issue? – Alberto Maianti Dec 9 '13 at 14:02

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.