none
SharePoint Ribbon fails to load RRS feed

  • Question

  • Hello Team,

    I have issue with SharePoint ribbon for Document Library, here is the scenario

    i have added custom webpart on default view page of SharePoinr document library, whenever i try to open that document library the page loads properly but the Ribbon fails to load, the ribbon gets loaded successfully if i select any document from library.

    Thanks in advance,

    Baba


    Thanks.... ________________ Baba (MCTS, MCPD)

    Tuesday, April 16, 2013 10:09 AM

Answers

  • Hi Baba,

    On this same page add a Content Editor Web part and add this javascript to it.

    setTimeout(function () {
                                            var elem = document.getElementById("MSOZoneCell_WebPartWPQ2");
                                            if (elem != null) {
                                                var dummyevent = new Array();
                                                dummyevent["target"] = elem;
                                                dummyevent["srcElement"] = elem;
                                                WpClick(dummyevent);
                                            }
                                        }, 100);

    Let me explain, the reason you do not see your Ribbon is because when you add another web part to the view in a list you are changing the page to a webpart page. The script above will, when the page loads move the focus to the listviewwebpart and will show your Ribbon again.

    By default the ID of the webpart is "WebPartWPQ2" It could be something else in your situation, to find the correct ID open SharePoint designer, open this list view and click on the web part with the list items and search for the correct ID. It will always be WebPartWPQ{XX}

    Regards
    Pieter
    Tuesday, April 16, 2013 1:25 PM

All replies

  • Does the custom webpart you added use any javascript? You might have a javascript issue caused by a variable being overwritten?

    Regards, Matthew
    MCPD | MCITP
    My Blog
    Please remember to click "Mark As Answer" if a post solves your problem or "Vote As Helpful" if it was useful.

    Tuesday, April 16, 2013 10:38 AM
  • Thanks for the reply Matthew.

    yes it has JavaScript, but i dont think its overwriting any of the variable from SharePoint,

    which variable are you talking about? i will check that.


    Thanks.... ________________ Baba (MCTS, MCPD)

    Tuesday, April 16, 2013 11:03 AM
  • I'd start by using the Developer Dashboard (IE) or Firebug (Firefox) to check for JavaScript issues. It sounds like some of the JavaScript (used for the ribbon) isn't initialised correctly when your page loads, which could be due to a variable conflict with your webpart.


    Regards, Matthew
    MCPD | MCITP
    My Blog
    Please remember to click "Mark As Answer" if a post solves your problem or "Vote As Helpful" if it was useful.

    Tuesday, April 16, 2013 1:16 PM
  • Hi Baba,

    On this same page add a Content Editor Web part and add this javascript to it.

    setTimeout(function () {
                                            var elem = document.getElementById("MSOZoneCell_WebPartWPQ2");
                                            if (elem != null) {
                                                var dummyevent = new Array();
                                                dummyevent["target"] = elem;
                                                dummyevent["srcElement"] = elem;
                                                WpClick(dummyevent);
                                            }
                                        }, 100);

    Let me explain, the reason you do not see your Ribbon is because when you add another web part to the view in a list you are changing the page to a webpart page. The script above will, when the page loads move the focus to the listviewwebpart and will show your Ribbon again.

    By default the ID of the webpart is "WebPartWPQ2" It could be something else in your situation, to find the correct ID open SharePoint designer, open this list view and click on the web part with the list items and search for the correct ID. It will always be WebPartWPQ{XX}

    Regards
    Pieter
    Tuesday, April 16, 2013 1:25 PM