1

I'm trying to add button to a custom list. It seems impossible to me, below is my button definition from elements.xml

<CustomAction Id="CopyTasksButton2" Location="CommandUI.Ribbon"
            RegistrationType="List" RegistrationId="10028">
<CommandUIExtension>
  <CommandUIDefinitions>
    <CommandUIDefinition
      Location="Ribbon.ListItem.New.Controls._children">
      <Button Id="Ribbon.ListItem.New.Controls.ReplacementButton"
        Command="ReplacementButtonCommand"
        Sequence="25"
        Image32by32="/_layouts/1045/images/formatmap32x32.png" Image32by32Top="-320" Image32by32Left="-384"
        Image16by16="/_layouts/1045/images/formatmap16x16.png" Image16by16Top="-160" Image16by16Left="-192"
        LabelText="Replaced Button"
        TemplateAlias="o2" />
    </CommandUIDefinition>
  </CommandUIDefinitions>
  <CommandUIHandlers>
    <CommandUIHandler
      Command="ReplacementButtonCommand"
      CommandAction="javascript:alert('This button has been replaced.');" />
  </CommandUIHandlers>
</CommandUIExtension>

I got this code from some tutorial. Here's link text a similiar post describing the same problem. I tried changing tollbar mode in list definition from Standard to Regular, but the button still don't show up. Anyone knows how to solve it ?

EDIT: Even more strange thing: it works fine on another custom list (I only changed RegistrationId). The only difference between them is the fact, that the list on which it's working fine was created programatically during deployment.

  • Looks fine to me - I suspect from your edit that the RegistrationId is likely the problem. Did you change the RegistrationId between when you manually and programmatically creating the two lists? – Andy Burns Dec 27 '10 at 11:17
  • I'm sure it's fine, I know the answer and I'll post it in a sec. – user2052 Dec 29 '10 at 11:24
0

The problem was the fact, that the feature adding custom actions file was not activated on the site I had my list on.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy