简体   繁体   中英

Sharepoint 2010 Custom Action not appearing

I've created a custom action and added it to a feature but it doesn't appear where it should when I activate the feature, not sure what's going wrong. Code below:

<?xml version="1.0" encoding="utf-8"?>
 <Elements xmlns="http://schemas.microsoft.com/sharepoint/">
   <CustomAction
    Id="0b5d3f99-ea17-4a93-ba04-9744a8c099af"
    RegistrationType="List"
    Title="Developer User Action"
    RegistrationId="0x0100f5be96b7d764406681760305e87f90ac"
    Sequence="4"
    Location="CommandUI.Ribbon.Display">
   <CommandUIExtension>
   <CommandUIDefinitions>
    <CommandUIDefinition Location="Ribbon.ListForm.Display.Actions.Controls._children">
      <Button 
        Id="Ribbon.ListForm.Display.Actions.DeveloperButton"
        Command="OpenWebPart"
        Image32by32="/_layouts/images/Actinium/Icons-Large/note_edit.png"
        Image16by16="/_layouts/images/Actinium/Icons-Small/note_edit.png"
        Sequence="4"
        LabelText="User/Developer Request"
        Description="Back and forth between developer/user to give results of request."
        TemplateAlias="o1" />
    </CommandUIDefinition>
  </CommandUIDefinitions>
  <CommandUIHandlers>
    <CommandUIHandler Command="OpenWebPart" CommandAction="javascript:window.open('http://www.google.ca')"></CommandUIHandler>
  </CommandUIHandlers>
</CommandUIExtension>
</CustomAction>
</Elements>

I managed to get this working, I made a few changes in the code, see below:

<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
 <CustomAction
Id="0b5d3f99-ea17-4a93-ba04-9744a8c099af"
RegistrationType="List"
Title="Developer User Action"
 RegistrationId="10015"
 Sequence="4"
 Location="CommandUI.Ribbon.DisplayForm">
<CommandUIExtension>
  <CommandUIDefinitions>
    <CommandUIDefinition Location="Ribbon.ListForm.Display.Actions.Controls._children">
      <Button 
        Id="Ribbon.ListForm.Display.Actions.DeveloperButton"
        Command="OpenWebPart"
        Image32by32="/_layouts/images/Masco/Icons-Large/note_edit.png"
        Image16by16="/_layouts/images/Masco/Icons-Small/note_edit.png"
        Sequence="4"
        LabelText="User/Developer Request"
        Description="Back and forth between developer/user to give results of request."
        TemplateAlias="o1" />
    </CommandUIDefinition>
  </CommandUIDefinitions>
  <CommandUIHandlers>
    <CommandUIHandler Command="OpenWebPart" CommandAction="javascript:window.open('http://www.google.ca')"></CommandUIHandler>
  </CommandUIHandlers>
</CommandUIExtension>
</CustomAction>
</Elements>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM