0
votes

I followed this link to create custom ribbon tab/group/controls in a custom web part.

The custom ribbon tab/group/control renders when web part is displayed on the page, however, all the buttons are disabled.

What I did:

  1. During OnLoad event, initialized List of IRibbonCommand with all my button command id; initialized page component and registered with SPRibbonScriptManager; registered ribbon scripts for getglobalCommands, commandEnabled, and handleCommand.
  2. During OnPreRender event, use SPRibbon to load XML and RegisterDataExtension for the whole structures; use SPRibbon to MakeTabAvailable and set InitialTabId.

PageComponent script has been registered and initialized properly. Tab/Group/Control are displayed but buttons are disabled and the info indicates 'the control is currently disabled'. I am the site administrator and have full permission so security is not a problem.

Any idea?

1
could you provide some code parts? - user536231
I followed the example at blog.dennus.net/2010/07/20/… and got it working. My main problem was missing the pageComponent command registering for the contextual group/tab. - sean

1 Answers

2
votes

I fixed the problem: it is important to register all commands with script manager before running page component initialization code via script.