Deep Dive on SharePoint Ribbon Development and Extensibility Chris O’Brien SharePoint MVP Independent OSP433
tab ribbon group {template} control contextual tab group contextual tab
demo Chris O’Brien SharePoint MVP Independent Customizing the SharePoint Ribbon
Command UI Handler – code sample <CommandUIHandler Command="MyCommandName" CommandAction="javascript:doSomething();" EnabledScript="javascript:checkSomething();" />
Page component – code sample canHandleCommand: function myCheckFunction (commandID) { return (commandID === "MyCommand") ? true : false; }, handleCommand: function myHandleFunction (commandID, properties, sequence) { if (commandID === "MyCommand") { // do stuff here.. }
Advantages Easy to create Easy to manage Great for simple commands Disadvantages If complex, hard to manage Lots of JavaScript can be hard to manage Not cached on the client Not reusable outside of the definition Command Handler Analyzed
Advantages External JS library Easier to manage & debug Can be minified Allows for greater control over commands Enable/disable command Block loss of focus Reusable across customizations Disadvantages Poor JavaScript dev tools Must be added to the page More work (build, register & initialize on page) All OO JavaScript
Global Commands Always available when on a page (if CanExecute says it is available) Focused Command Only available at specific times, e.g. when web part has focus Example: Content Editor Web Part controls
demo Chris O’Brien SharePoint MVP Independent Ribbon commands
SplitButton Easy default plus sub-menu ToggleButton Off or on Spinner Select within a range
demo Chris O’Brien SharePoint MVP Independent Advanced ribbon customizations
Server side: SPRibbon.MakeTabAvailable For contextual tab SPList.UserCustomActions Target an individual list JavaScript: RefreshCommandUI() Refresh ribbon, e.g. in async callback SP.SOD.ExecuteOr DelayUntilScriptLoaded() Deal with JS dependencies
Chris O’Brien : ribbon samples - (adding a tab/group/button, cool controls [SplitButton, ToggleButton, Spinner], static/dynamic FlyoutAnchor samples) Andrew Connell : ribbon samples - (contextual tabs, commands explained, async processing, dialogs)
Session OSP337 - Branding and Customizing My Sites with Microsoft SharePoint Server 2010 Exam – PRO: Designing and Developing Microsoft SharePoint 2010 Applications Find Me Later At – TLC 10am Thursday
The Business Collaboration Platform for the Enterprise & the Internet The capabilities of SharePoint 2010 provide a powerful business collaboration platform
Connect. Share. Discuss. Learning Microsoft Certification & Training Resources TechNet Resources for IT Professionals Resources for Developers
Required Slide Complete an evaluation on CommNet and enter to win!