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?

2 Answers 2

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.

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .