0

I have a VF page that displays a datatable. However, neither the Global Search nor the Sidebar collapse button work when I'm on the VF page.

enter image description here

Any ideas? Note: In the custom button that spawns the VF page and the VF page itself I have code that detects whether the page in opened in the standard interface or the service console.

Thanks!

  • 2
    Presumably your page's JavaScript is breaking the platform's JavaScript. First check the JavaScript console for errors. Then review the JavaScript (including any script includes as all that included code runs immediately too). If it is still not clear what the problem is, remove JavaScript pieces from your page one by one until you find the problematic piece. – Keith C Apr 5 '16 at 21:37
1

Yes I was overwriting the default onload functionality. Used the following code to detect default onload functionality and append any additional custom actions to it:

function addLoadEvent(func){ 
        var oldonload = window.onload; 
        if (typeof window.onload != 'function') 
            { 
                window.onload = func; 
            } 
        else
            { 
                window.onload = function()  
                { 
                    if (oldonload) 
                    { 
                        oldonload(); 
                    } 
                    func(); 
                } 
            } 
        } 

    addLoadEvent(function(){ 
        openOrderLineHistorySubtab();
});
  • 1
    Really, you shouldn't be using the old-school "onload" handler anyways. A more appropriate design for modern code is to instead use window.addEventListener. This means you don't have to worry about all that code you have now and can just get on doing whatever it is your code is doing. – sfdcfox Apr 8 '16 at 15:44

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.