none
SharePoint 2010 Ribbon - JavaScript error for pagecomponent.js RRS feed

  • Question

  • Hi,

    We are working on SharePoint 2010 Ribbon to have dynamically built Ribbon buttons and its Flyouts. We built this based on following post:

    http://patrickboom.wordpress.com/2010/05/25/adding-a-custom-company-menu-tab-with-dynamic-menu-on-the-ribbon/

    We have been able to get most of it working. However, there seems to be an intermittent JavaScript error when the page loads and the Ribbon Flyouts stops working (though the ribbon does not appear greyed-out).

    JavaScript error:
    Object Expected
    pagecomponent.js
    http://servername:port/_layouts/<projectname>/pagecomponent.js

    This is not noted when we do a browser refresh, but occurs while navigating other custom pages. This is not noted always, but very frequent. Additionally, our SharePoint 2010 environment is configured with Reporting Services in Integrated mode. Almost all the Reporting Services options for an RDL, DataSource, etc. (like Manage Subscriptions, Manage Parameters, Edit Data Source Definition, View Report History, etc.) seem to stop working and show "Cannot complete this action" generic message when accessed. Since our Ribbon is deployed using a custom Feature, when we de-activate the Feature, the Reporting Serivces options work fine.

    Similar issue is posted here (see number 10):
    http://social.technet.microsoft.com/Forums/en-US/sharepoint2010programming/thread/014a1a6a-7922-4e54-b5fd-a8737d98c1a0

    No one seem to have posted the resolution in either of the posts. We are not sure if this is a known-issue but seem to have faced by many. This is a critical one for us to get resolve. We would highly appretiate if we get your prompt help on resolving this issue. Thanks.


    Regards, Anwar
    • Edited by Anwarali Hajwane Tuesday, December 14, 2010 12:13 AM Added Reporting Serivces options
    Tuesday, December 14, 2010 12:07 AM

Answers

All replies

  • Hi,

    We are working on SharePoint 2010 Ribbon to have dynamically built Ribbon buttons and its Flyouts. We built this based on following post:

    http://patrickboom.wordpress.com/2010/05/25/adding-a-custom-company-menu-tab-with-dynamic-menu-on-the-ribbon/

    We have been able to get most of it working. However, there seems to be an intermittent JavaScript error when the page loads and the Ribbon Flyouts stops working (though the ribbon does not appear greyed-out).

    JavaScript error:
    Object Expected
    pagecomponent.js
    http://servername:port/_layouts/<projectname>/pagecomponent.js

    This is not noted when we do a browser refresh, but occurs while navigating other custom pages. This is not noted always, but very frequent. Additionally, our SharePoint 2010 environment is configured with Reporting Services in Integrated mode. Almost all the Reporting Services options for an RDL, DataSource, etc. (like Manage Subscriptions, Manage Parameters, Edit Data Source Definition, View Report History, etc.) seem to stop working and show "Cannot complete this action" generic message when accessed. Since our Ribbon is deployed using a custom Feature, when we de-activate the Feature, the Reporting Serivces options work fine.

    Similar issue is posted here (see number 10):
    http://social.technet.microsoft.com/Forums/en-US/sharepoint2010programming/thread/014a1a6a-7922-4e54-b5fd-a8737d98c1a0

    No one seem to have posted the resolution in either of the posts. We are not sure if this is a known-issue but seem to have faced by many. This is a critical one for us to get resolve. We would highly appretiate if we get your prompt help on resolving this issue. Thanks.


    Regards, Anwar

     

    Same Problem, Any solution :(

    Tuesday, December 14, 2010 5:54 AM
  • Hi,

    How about IE developer toolbar? It will show you where exactly it is throwing up.

    You can download it from here...
    http://www.microsoft.com/downloads/en/details.aspx?FamilyID=95e06cbe-4940-4218-b75d-b8856fced535

    hope this helps...

     


    Vighnesh Bendre
    http://markviky.blogspot.com
    • Marked as answer by Wayne Fan Thursday, December 23, 2010 2:58 AM
    Wednesday, December 15, 2010 10:42 AM
  • I have the same problem as indicated in the original post, I do not have flyout buttons but just basic button/toggle button. I have own contextual group/tab/controls dynamically created via RegisterDataExtension from custom web parts.

    The problem is also sporadic but fairly frequent. When problem occurs, all Ribbon buttons renders but were disabled and JavaScript error shows as:

    object expected: pagecomponent.js error at line 52 char 9

    It fails at PageComponent.js at the following location (return statement):

     

    getGlobalCommands: function
    
     () {
      ULS_SP();
      return
    
     getGlobalCommands();
    },
    

    Any idea?

    Thanks in advance.

    Sean

     

    Wednesday, January 26, 2011 12:01 AM
  • We solved the problem by replacing getGlobalCommands(); with actual commands that we require. This is kind of hardcoding but as of now solves our issue.
    Regards, Ojas
    Wednesday, January 26, 2011 4:36 AM
  • Hi Ojas, could you give us the code you use to replace the getGlobalCommands function?,, we have been trying to solve this issue but we can't find how to fix this, thanks in advance.
    • Edited by Diego_f Monday, September 3, 2012 9:47 PM
    Monday, September 3, 2012 9:47 PM
  • We have implemented it as following method.

    getGlobalCommands: function () {
            ULS_SP();
    //        var retVal = getGlobalCommands();
    //        if (retval == null) {
    //        }
            return ['PopulateDymamicMenuItemsQueryCommand1', 'PopulateDymamicMenuItemsQueryCommand2', 'PopulateDymamicMenuItemsQueryCommand3'];
    
        },


    Regards,
    Ojas Maru (My blog)

    Tuesday, September 4, 2012 4:53 AM