Add Change Item order ribbon in Sharepoint 2010 - sharepoint

I want to add Change item order ribbon into ribbon panel. I have created feature and activated, however i still cant see the item order ribbon. Can anyone help me with this?
below is my code
<?xml version="1.0" encoding="utf-8" ?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<!--Change Item order Ribbon-->
<CustomAction
Id="SPChangeItemOrder"
Location="CommandUI.Ribbon.ListItem"
RegistrationId="101"
RegistrationType="List"
Title="List View Ribbon Customization"
>
<CommandUIExtension>
<CommandUIDefinitions>
<CommandUIDefinition Location="Ribbon.ListItem.Actions.Controls._children">
<!--Get Details from CMDUI.XML-->
<Button
Id="Ribbon.ListItem.Actions.ChangeItemOrder"
Alt="Change the order of the items in this list."
Sequence="20"
Command="ChangeLinkOrder"
LabelText="$Resources:core,cui_ButChangeItemOrder;"
ToolTipTitle="$Resources:core,cui_ButChangeItemOrder;"
ToolTipDescription="$Resources:core,cui_STT_ButChangeItemOrder;"
TemplateAlias="o2"
Image16by16="/_layouts/$Resources:core,Language;/images/formatmap16x16.png" Image16by16Top="-192" Image16by16Left="-144"
Image32by32="/_layouts/$Resources:core,Language;/images/formatmap32x32.png" Image32by32Top="-192" Image32by32Left="-288"
/>
</CommandUIDefinition>
</CommandUIDefinitions>
<CommandUIHandlers>
<CommandUIHandler Command="ChangeLinkOrder" CommandAction="javascript:alert('Please check Change Item Order');"></CommandUIHandler>
</CommandUIHandlers>
</CommandUIExtension>
</CustomAction>

Try something like this where RegistrationID is the Type value of a list definition. You don't need the CommandUIHandler if you want to use SharePoint's OOB Change Item Order command.
<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<!--Change Item order Ribbon-->
<CustomAction
Id="XYZ.Webpart.Links.XYZLinksListDefinition.RibbonSortOrderButton"
Location="CommandUI.Ribbon"
RegistrationId="30099"
RegistrationType="List"
Title="List View Ribbon Customization" >
<CommandUIExtension>
<CommandUIDefinitions>
<CommandUIDefinition Location="Ribbon.ListItem.Actions.Controls._children">
<Button
Id="Ribbon.ListItem.Actions.RibbonSortOrderButton"
Sequence="25"
Command="ChangeLinkOrder"
Image16by16="/_layouts/$Resources:core,Language;/images/formatmap16x16.png" Image16by16Top="-192" Image16by16Left="-144"
Image32by32="/_layouts/$Resources:core,Language;/images/formatmap32x32.png" Image32by32Top="-192" Image32by32Left="-288"
LabelText="$Resources:core,cui_ButChangeItemOrder;"
ToolTipTitle="$Resources:core,cui_ButChangeItemOrder;"
ToolTipDescription="$Resources:core,cui_STT_ButChangeItemOrder;"
TemplateAlias="o1" />
</CommandUIDefinition>
</CommandUIDefinitions>
</CommandUIExtension>
</CustomAction>
</Elements>

Invalid value for attribute location in customaction element, choose right location value from here http://msdn.microsoft.com/en-us/library/bb802730.aspx

Related

SharePoint - Ribbon Button showing wrong LabelText

I have a Ribbon Button with the following XML:
<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<CustomAction
Id="Ribbon.Library.Actions.AddAButton"
Location="CommandUI.Ribbon"
RegistrationId="171"
RegistrationType="List"
Title="Change Email Ribbon Button">
<CommandUIExtension>
<CommandUIDefinitions>
<CommandUIDefinition
Location="Ribbon.ListForm.Edit.Commit.Controls._children">
<Button Id="Ribbon.ListForm.Edit.Commit.NewRibbonButton"
Command="ChangeEmailButtonCommand"
Image16by16="/_layouts/15/$Resources:core,Language;/images/formatmap16x16.png?rev=23" Image16by16Top="-127" Image16by16Left="-91"
Image32by32="/_layouts/15/$Resources:core,Language;/images/formatmap32x32.png?rev=23" Image32by32Top="-477" Image32by32Left="-307"
LabelText="$Resources:Toolkit,ChangeEmailButtonLabel"
TemplateAlias="o2" />
</CommandUIDefinition>
</CommandUIDefinitions>
<CommandUIHandlers>
<CommandUIHandler
Command="ChangeEmailButtonCommand"
CommandAction="javascript:
ChangeEmailAction();
" />
</CommandUIHandlers>
</CommandUIExtension>
</CustomAction>
<CustomAction Id="Ribbon.ListForm.Edit.Commit.Scripts" Location="ScriptLink" ScriptSrc="/_layouts/15/GOToolkit/JS/loadJsOrCssFile.js?version=1.7.3" />
</Elements>
Now, the LabelText on my button, shows the exact same text, as it does in the XML: "$Resources:Toolkit,ChangeemailButtonLabel", where I'd expect it to show the text that I have defined in the 'ChangeEmailButtonLabel', which looks like this:
<data name="ChangeEmailButtonLabel" xml:space="preserve">
<value>Change email</value>
</data>
Am I missing something here?
Check that your resources file is stored in the SharePoint Resources folder.
Also, don't know if it's a game changer but you can add ";" at the end of your syntax.

How to use custom dispForm in sharepoint list view?

I am using list view to show the list items in share point 2013. When user clicks the title the custom page should be shown instead of default display page(dispForm.aspx) of share-point.
Define XmlDocuments in contentType:
https://msdn.microsoft.com/en-us/library/office/aa543825.aspx
Example:
<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<!-- Parent ContentType: Workflow Task (0x010801) -->
<ContentType ID="0x010100AF4E4BE6CF8048959C4172F4298CE42A"
Name="MyName"
Group="MyGroup"
Description="MyDescription"
Version="0">
<FieldRefs>
</FieldRefs>
<XmlDocuments>
<XmlDocument NamespaceURI ="http://schemas.microsoft.com/sharepoint/v3/contenttype/forms/url">
<FormUrls xmlns="http://schemas.microsoft.com/sharepoint/v3/contenttype/forms/url">
<New>_layouts/MyFolder/New.aspx</New>
<Display>_layouts/MyFolder/New.aspx</Display>
<Edit>_layouts/MyFolder/Edit.aspx</Edit>
</FormUrls>
</XmlDocument>
</XmlDocuments>
</ContentType>
</Elements>
In code behind you get current item
SPListItem item = SPContext.Current.ListItem;

Excel/RibbonUI menu disabled

Note The following problem was solved by creating a new workbook copying all the data, macros and other code across. Any insight into what causes a workbook to "break" would be welcome!
I have an excel file with a custom ribbonui. I've recently added a new group with a new menu, it (was) copied from the first group and certain items were removed.
The first group "library" and all its controls work as expected. The "documentmenu" menu in the "document" group however is grayed out and I cannot figure out why!
I've tried adding in a getEnabled and plain enabled attribute to the menu but it wont fire, neither will any of the getEnabled events for the menu's contained buttons.
When I open the ribbon for the first time the getLabel event does fire and sets the label correctly.
I've tried re-naming the group and all the controls to something without "document" in-case it's conflicting somehow, but again no go.
Does anyone know what might be causing this to happen?
Below is the entire customui xml file.
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<customUI
onLoad="CustomUI.Ribbon_onLoad"
xmlns="http://schemas.microsoft.com/office/2009/07/customui">
<ribbon>
<tabs>
<tab
id="Main"
label="Initech">
<group
id="Library"
label="Library"
tag="Library"
centerVertically="true">
<menu
id="LibraryMenu"
tag="Library"
image="gear"
getLabel="CustomUI.Menu_getLabel">
<button
id="LibraryMenu_Open"
tag="Library"
label="Open Library"
imageMso="FileOpen"
getEnabled="CustomUI.Button_getEnabled"
onAction="CustomUI.Button_onAction" />
<button
id="LibraryMenu_New"
tag="Library"
label="New Library"
imageMso="FileNew"
getEnabled="CustomUI.Button_getEnabled"
onAction="CustomUI.Button_onAction" />
<menuSeparator
id="LibraryMenu_Separator0" />
<button
id="LibraryMenu_Save"
tag="Library"
label="Save"
imageMso="FileSave"
getEnabled="CustomUI.Button_getEnabled"
onAction="CustomUI.Button_onAction" />
<button
id="LibraryMenu_Close"
tag="Library"
label="Close"
imageMso="FileClose"
getEnabled="CustomUI.Button_getEnabled"
onAction="CustomUI.Button_onAction" />
<button
id="LibraryMenu_Default"
tag="Library"
label="Set as Default"
imageMso="AcceptInvitation"
getEnabled="CustomUI.Button_getEnabled"
onAction="CustomUI.Button_onAction" />
<menuSeparator
id="LibraryMenu_Separator1" />
<button
id="LibraryMenu_Add"
tag="Library"
label="Add Component"
getEnabled="CustomUI.Button_getEnabled"
onAction="CustomUI.Button_onAction" />
<button
id="LibraryMenu_Editor"
tag="Library"
label="Edit Menu"
getEnabled="CustomUI.Button_getEnabled"
onAction="CustomUI.Button_onAction" />
</menu>
<dynamicMenu
id="LibraryComponents"
tag="Library"
image="book_stack"
getLabel="CustomUI.Menu_getLabel"
getEnabled="CustomUI.Menu_getEnabled"
getContent="CustomUI.Menu_getContent" />
</group>
<group
id="Document"
label="Document"
tag="Document"
centerVertically="true">
<menu
id="DocumentMenu"
tag="Document"
imageMso="FileOpen"
getLabel="CustomUI.Menu_getLabel">
<button
id="DocumentMenu_Open"
tag="Document"
label="Open Document"
imageMso="FileOpen"
getEnabled="CustomUI.Button_getEnabled"
onAction="CustomUI.Button_onAction" />
<button
id="DocumentMenu_New"
tag="Document"
label="New Document"
imageMso="FileNew"
getEnabled="CustomUI.Button_getEnabled"
onAction="CustomUI.Button_onAction" />
<menuSeparator
id="DocumentMenu_Separator0" />
<button
id="DocumentMenu_Save"
tag="Document"
label="Save"
imageMso="FileSave"
getEnabled="CustomUI.Button_getEnabled"
onAction="CustomUI.Button_onAction" />
<button
id="DocumentMenu_Close"
tag="Document"
label="Close"
imageMso="FileClose"
getEnabled="CustomUI.Button_getEnabled"
onAction="CustomUI.Button_onAction" />
</menu>
</group>
</tab>
</tabs>
</ribbon>
</customUI>
Update after hours of playing about trying to figure out whats going on, turns out my workbook is damaged some how. The code works fine if I put it into a new workbook.
centerVertically is not a valid property.
Kindly refer this link
getEnabled="CustomUI.Button_getEnabled" & onAction="CustomUI.Button_onAction"
Avoid period . in name of callback function as we cannot define a sub/function like CustomUI.Button_getEnabled.
3 when using getEnabled attribute for a button a callback function is to be called when the application needs to determine the enabled state of the button.
sample code - getEnabled for ribbion

List menu by Parse XML in J2ME

I want to create menu from XMLFile. My xml is like this
<?xml version="1.0" encoding="UTF-8"?>
<root>
<parent title="Layanan Anda">
<menu title="Info Kartu">
<submenu title="Informasi Saldo">
<input type="numberpassword" length="4">Kode </input>
</submenu>
<submenu title="Mutasi Kartu Utama">
<input type="numberpassword" length="4">Kode </input>
</submenu>
<submenu title="Mutasi Kartu Lain">
<input type="number" length="10">Kartu</input>
<input type="numberpassword" length="4">Kode </input>
</submenu>
<submenu title="Deposito">
<input type="number" length="10">Bilyet</input>
<input type="numberpassword" length="4">Kode </input>
</submenu>
</menu>
<menu title="Kartu Anda">
</menu>
<menu title="Other Info">
</menu>
<menu title="Isi">
</menu>
</parent>
<parent title="Menu Favorit">
</parent>
<parent title="Recent Menu">
</parent>
<parent title="Setting">
</parent>
</root>
In HomeScreen, list menu parent will show first. And when I click parent menu, application will show list menu from "menu" tag. When I click menu again, application will show list menu from submenu. And vice versa when I want to back to parent menu.
How can I implement this in J2ME?
Parse your XML file and create a tree structure to hold the menu/submenu items. Each node should hold the items of a single level. For example:
root: Layanan Anda, Menu Favorit, Recent Menu, Setting
menu: Info Kartu, Kartu Anda, Other Info, Isi
submenu: Informasi Saldo, Mutasi Kartu Utama, Mutasi Kartu Lain, Deposito
Then use a graphical List to show the items of a node.

Custom SharePoint 2010 Documentset contenttype

I'm working on a custom contenttype of the type Documentset.
I want to set the alllowed contenttypes, but this is not working, it's only showing the defeult document. I read several blogs but i can't find my solution.
<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<!-- Parent ContentType: Document Set (0x0120D520) -->
<ContentType ID="0x0120D520008d2ff418027e4c31b54d155b98596748"
Overwrite="True"
Name="Custom Dossier"
Group="Custom group"
Description="Custom dossier"
Inherits="True"
Version="0">
<FieldRefs>
<FieldRef ID="{8D6C094C-3E1F-41f4-BEE3-25B27EE09702}" Name="Dossier_Nummer" DisplayName="Dossiernummer" Required="True" />
</FieldRefs>
<XmlDocuments>
<XmlDocument NamespaceURI="http://schemas.microsoft.com/office/documentsets/allowedcontenttypes">
<act:AllowedContentTypes xmlns:act="http://schemas.microsoft.com/office/documentsets/allowedcontenttypes" LastModified="05/31/2012 08:46:56">
<AllowedContentType id="0x0101" />
<AllowedContentType id="0x0101000490d50c50624b6ca21c637ef39cd89b" />
</act:AllowedContentTypes>
</XmlDocument>
</XmlDocuments>
</ContentType>
</Elements>
You can use ContentType binding element for assigning CTs to document library.
Have you tried adding all the nodes necessary for the document set template? A great example is located here: http://code.msdn.microsoft.com/office/Create-Custom-Document-Set-318393ce/sourcecode?fileId=57420&pathId=1173424883

Resources