2

When I deploy this ribbon customization, I get the contextual out-of-the-box tab for calendars doubled (Events Calendar Events Calendar) and the custom one never shows.

I have this code:

<CustomAction Id="Ribbon.MyCustomContextualTab" 
            Location="CommandUI.Ribbon.ListView" 
            RegistrationId="106" 
            RegistrationType="List">
<CommandUIExtension>
  <CommandUIDefinitions>
    <CommandUIDefinition Location="Ribbon.ContextualTabs._children">
      <ContextualGroup Id="Ribbon.ContextualTabs.MyContextualGroup" 
                       Sequence="901"
                       Color="DarkBlue"
                       Command="Ribbon.ContextualTabs.MyContextualGroup" 
                       ContextualGroupId="MyContextualGroup">
        <Tab Id="Ribbon.MyContextualGroup.Tab" 
             Title="Test" 
             Command="Ribbon.MyContextualGroup.Tab" 
             Description="testing" 
             Sequence="1001">
          <Scaling Id="Ribbon.MyContextualGroup.Scaling">
            <MaxSize Id="Ribbon.MyContextualGroup.Scaling.MaxSize" GroupId="Ribbon.MyContextualGroup.Tab.MaxSize" Size="LargeLarge"/>
          </Scaling>
          <Groups Id="Ribbon.MyContextualGroup.Groups">
            <Group Id="Ribbon.aQura.Tab.Console"
              Sequence="1"
              Command="Ribbon.MyContextualGroup.Tab.Grup"
              Description=""
              Title="Grupul"
              Template="Ribbon.Templates.Flexible2">
              <Controls Id="Ribbon.MyContextualGroup.Controls">
                <Button Id="Ribbon.MyContextualGroup.Primul"
                  Alt="Buton"
                  Sequence="101"
                  Command="Primul_Button"
                  LabelText="Primul"
                  Image32by32="/_layouts/Images/RibbonItem/Notify32X32.png"
                  Image16by16="/_layouts/Images/RibbonItem/Notify16X16.png"
                  TemplateAlias="o1"/>
                <Button Id="Ribbon.MyContextualGroup.AlDoilea"
                  Alt="Buton"
                  Sequence="102"
                  Command="AlDoilea_Button"
                  LabelText="AlDoilea"
                  Image32by32="/_layouts/Images/RibbonItem/Question32X32.png"
                  Image16by16="/_layouts/Images/RibbonItem/Question16X16.png"
                  TemplateAlias="o1"/>
              </Controls>
            </Group>
          </Groups>
        </Tab>
      </ContextualGroup>
    </CommandUIDefinition>
  </CommandUIDefinitions>
  <CommandUIHandlers>
    <CommandUIHandler
        Command="Ribbon.ContextualTabs.MyContextualGroup"
        CommandAction="" EnabledScript="return true;" />
    <CommandUIHandler
        Command="Ribbon.MyContextualGroup.Tab"
        CommandAction="" />
    <CommandUIHandler
        Command="Ribbon.MyContextualGroup.Tab.Grup"
        CommandAction ="" />
    <CommandUIHandler
        Command="Primul_Button"
        CommandAction="javascript: alert('primul');" />
    <CommandUIHandler
        Command="AlDoilea_Button"
        CommandAction="javascript: alert('al doilea');" />
  </CommandUIHandlers>
       </CommandUIExtension>
    </CustomAction> 

What am I missing ?

2

You can't add a custom contextual group to an already existing web part.

You basically have two options:

  1. Create a custom web part which shows the calendar and the default contextual wp as well as your own
  2. Add tabs/controls to the default contextual group of the calendar. That is to the Ribbon.Calendar contextual group.

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.