WebHosting

Showing posts with label sharepoint ribbon. Show all posts
Showing posts with label sharepoint ribbon. Show all posts

Thursday, November 10, 2011

Adding a Custom Action to a SharePoint 2010 Display Form for List Items

Creating Custom Actions Overview

It is common when customizing SharePoint 2010 to want to extend the user interface. Fortunately, this is easy to do by using the ribbon menu. You can add new functionality to the SharePoint 2010 ribbon as custom actions. Custom actions enable you to expand or extend the standard behavior of SharePoint 2010 core components such as using a custom action to email the details of a list item.
This topic describes two approaches for adding a custom action to a display form of SharePoint 2010 list items. The custom action is added to the ribbon as a button.
You have two options to add custom actions to a display form:
  • Adding a custom action through SharePoint 2010 features. SharePoint features enable you to easily deploy customizations. This is the preferred method when you need to package the customizations and deploy them to different servers.
  • Adding a custom action by using Microsoft SharePoint Designer 2010. SharePoint Designer helps create rapid, no-code customizations on the local server.

Creating a Custom Web Part with a Contextual Tab

This topic shows how to create a custom Web Part that opens a contextual tab on the Server ribbon in Microsoft SharePoint Foundation.
Microsoft SharePoint Foundation 2010
SharePoint development tools in Microsoft Visual Studio 2010
To create the Web Part and ribbon customization, start by creating an empty SharePoint project.

To create a SharePoint Project

  1. Start Visual Studio 2010.
  2. On the File menu, point to New, and then click Project.
  3. In Project Types, under C#, select Empty SharePoint Project.
  4. Type ContextualTabWebPart as the project name, and then click OK.
  5. In the SharePoint Customization Wizard, select Deploy as a farm solution, and then click Finish.

Adding a Tab to the Server Ribbon

This topic describes how to add a new tab to the Server ribbon in Microsoft SharePoint Foundation.
SharePoint Foundation 2010
SharePoint development tools in Microsoft Visual Studio 2010
To add a new tab, you start by creating an empty SharePoint project.

To create a SharePoint Project

  1. Start Visual Studio 2010.
  2. On the File menu, point to New, and then click Project.
  3. In Project Types, under Visual Basic or C#, select Empty SharePoint Project.
  4. Type AddARibbonTab as the project name, and then click OK.
  5. In the SharePoint Customization Wizard, select Deploy as a sandboxed solution, and then click Finish.

Developing Page Components for the Server Ribbon

A page component is an ECMAScript (JavaScript, JScript) object that is used to interact with the Server ribbon. It enables commands on the ribbon and responds to the commands that you define in the Server ribbon XML. All page components must derive from the CUI.Page.PageComponent Class class and implement the required methods. This topic explains those methods and how they are used when interacting with the ribbon.
A page component contains two types of commands—global and focused. A page component only responds to focused commands if it has the focus. With global commands, a page component responds to the command regardless of the focus. The page component registers to respond to both types of commands through the SP.Ribbon.PageState.PageStateHandler.getGlobalCommands() Method and the SP.Ribbon.PageState.PageStateHandler.getFocusedCommands() Method. These methods are covered in more detail later in this topic.

Adding a Button to the Server Ribbon

This topic describes how to add a new button to the Server ribbon in Microsoft SharePoint Foundation.
Microsoft SharePoint Foundation 2010
SharePoint development tools in Microsoft Visual Studio 2010
To add a new button, you start by creating an empty SharePoint project.

To create a SharePoint project

  1. Start Microsoft Visual Studio 2010.
  2. On the File menu, point to New, and then click Project.
  3. In Project Types, under Visual Basic or C#, select Empty SharePoint Project.
  4. Type AddARibbonButton as the project name. Click OK.
  5. In the SharePoint Customization Wizard, select Deploy as a sandboxed solution, and then click Finish.

Server Ribbon XML

The following topic describes Server ribbon XML and explains the values that are used for the attributes.

    <CommandUIExtension>
      <CommandUIDefinitions>
        <CommandUIDefinition 
          Location="Ribbon.Tabs._children">
          <Tab 
            Id="Ribbon.CustomTabExample" 
            Sequence="501" 
            Description="My New Tab" 
            Title="My New Tab">

Featured Posts

How to Enable and Configure Remote Desktop (RDP) on Ubuntu 24.04.4 LTS

Remote Desktop Protocol (RDP) support in Ubuntu has become considerably easier with the GNOME Remote Desktop stack included in modern Ubuntu...