Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

Here is my custom ribbon tab definition:

  <CustomAction
           Id="CustomRibbonTab"
           Location="CommandUI.Ribbon">
    <CommandUIExtension>
      <CommandUIDefinitions>
        <CommandUIDefinition
          Location="Ribbon.Tabs._children">
          <Tab
            Id="Ribbon.CustomTab"
            Title="Custom Tab"
            Description="Custom Tab !!!"
            Sequence="501">
            <Scaling
              Id="Ribbon.CustomTab.Scaling">
              <MaxSize
                Id="Ribbon.CustomTab.MaxSize"
                GroupId="Ribbon.CustomTab.CustomGroup"
                Size="OneLargeTwoMedium"/>
              <Scale
                Id="Ribbon.CustomTab.Scaling.CustomTabScaling"
                GroupId="Ribbon.CustomTab.CustomGroup"
                Size="OneLargeTwoMedium" />
            </Scaling>
            <Groups Id="Ribbon.CustomTab.Groups">
              <Group
                Id="Ribbon.CustomTab.CustomGroup"
                Description="Custom Group!"
                Title="Custom Group"
                Sequence="52"
                Template="Ribbon.Templates.CustomTemplate">
                <Controls Id="Ribbon.CustomTab.CustomGroup.Controls">
                  <Button
                    Id="Ribbon.CustomTab.CustomGroup.CustomButton"
                    Command="CustomTab.CustomButtonCommand"
                    Sequence="15"
                    Description=""
                    LabelText="Custom Button"
                    Image32by32="/_layouts/images/PPEOPLE.GIF"
                    TemplateAlias="cust1"/>

                </Controls>
              </Group>
            </Groups>
          </Tab>
        </CommandUIDefinition>
        <CommandUIDefinition Location="Ribbon.Templates._children">
          <GroupTemplate Id="Ribbon.Templates.CustomTemplate">
            <Layout
              Title="OneLargeTwoMedium"
              LayoutTitle="OneLargeTwoMedium">
              <Section Alignment="Top" Type="OneRow">
                <Row>
                  <ControlRef DisplayMode="Large" TemplateAlias="cust1" />
                </Row>
              </Section>
            </Layout>
          </GroupTemplate>
        </CommandUIDefinition>
      </CommandUIDefinitions>
      <CommandUIHandlers>
        <CommandUIHandler
          Command="CustomTab.CustomButtonCommand"
           CommandAction="javascript:alert('Hello, world!');" />
      </CommandUIHandlers>
    </CommandUIExtension>
  </CustomAction>

I didn't use RegistrationId and RegistrationType on the element because I am making the tab visible with a delegate control.

When the page loads, the tab becomes visible between Browse and Page tabs but when I click the tab title, the contents of the tab don't appear. Instead the Loading animation loops forever.

EDIT: Also when I click one of the other tabs before I click the custom tab, the tab disappears completely.

Any help is appreciated, thanks.

share|improve this question

1 Answer 1

up vote 2 down vote accepted

One great way to troubleshoot Ribbon customizations is to open up Internet Explorer Development Tools (preferably the ones in IE9) and then check the script console, most errors are reported there (sometimes with weird error messages though).

I also normally use Fiddler to see what Ribbon custommizations is retrieved (they are downloaded asynchronous).

And the third troubleshoting option is to open up IE in InPrivate browsing mode, so nothing gets cached. To be on the safe side, close and reopen IE InPrivate between each change you do to your customizations.

share|improve this answer
    
+1 on closing and reopening IE in InPrivate for caching. A real pain to develop. –  Bart Jan 5 '12 at 15:01

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.