I am adding a custom button to SP Ribbon with exactly same functionality as OOTB "Save and Close" button. I am trying to add it though custom action but other solutions are welcome as well. My problem with custom action is that Command Action is not firing
<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<CustomAction Id="Ribbon.CustomAction2"
Location="CommandUI.Ribbon"
Title="Custom Ribbon">
<CommandUIExtension>
<CommandUIDefinitions>
<CommandUIDefinition Location="Ribbon.WikiPageTab.EditAndCheckout.Controls._children">
<Button Id="Ribbon.CustomAction.Button2"
Sequence="30"
Alt="$Resources:core,save;"
Command="ECMAScriptComand"
CommandValueId="PageStateGroupSaveAndStop"
Image16by16="/_layouts/$Resources:core,Language;/images/formatmap16x16.png" Image16by16Top="-176" Image16by16Left="-96"
Image32by32="/_layouts/$Resources:core,Language;/images/formatmap32x32.png" Image32by32Top="-320" Image32by32Left="0"
LabelText="Workflows"
TemplateAlias="o1"
/>
</CommandUIDefinition>
</CommandUIDefinitions>
<CommandUIHandlers>
<CommandUIHandler Command="ECMAScriptComand"
CommandAction="javascript:HelloWorld()">
</CommandUIHandler>
</CommandUIHandlers>
</CommandUIExtension>
</CustomAction>
<CustomAction Id="Ribbon.Library.Actions.NewButton.Script"
Location="ScriptLink"
ScriptBlock="
function HelloWorld()
{
alert('Hello, world!');
var result=CoreInvoke('PageActionClick', this);
alert(result);
}" />
</Elements>
