<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-7021741417853834113</id><updated>2024-09-08T23:17:37.604+05:30</updated><category term="Ribbon Customization"/><category term="SharePoint 2010"/><category term="SharePoint Object Model 2010"/><category term="VS2010"/><title type='text'>MeVsMyself</title><subtitle type='html'>&lt;i&gt;If you are not a part of the problem,then you can never be a part of the solution.&lt;/i&gt;</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://makarandrkulkarni.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7021741417853834113/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://makarandrkulkarni.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>makarand Kulkarni</name><uri>http://www.blogger.com/profile/00881181707083196500</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>7</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-7021741417853834113.post-2674313969767921022</id><published>2010-01-23T17:23:00.007+05:30</published><updated>2011-02-07T18:48:41.654+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Ribbon Customization"/><category scheme="http://www.blogger.com/atom/ns#" term="SharePoint 2010"/><title type='text'>SharePoint 2010 Ribbon Customization Part V: How to dynamically populate ribbon controls?</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
In this article I will show you how we can populate ribbon controls on fly. Ribbon controls like combobox, dropdown, flyoutanchor, splitbutton, mrusplitbutton contains menuitems or they can host other controls like button with individual command and act like a menu. So their structure can be populates at design time in XML declaration as well as at runtime using javascript and code behind.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiVI6aRDYOgSUmD0Gbwg19BYAFci1S05ekDkYUbd0wREXv8IIalp4TRGbK80wBgvEotL7vp7ePJm6lcthpz3SRuRuicUUnSPVbbv5baO6nt-6A4D0TKgLvrlOWTEWP3Zg3v6P6bA5C0go6u/s1600/PartV.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; h5=&quot;true&quot; height=&quot;126&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiVI6aRDYOgSUmD0Gbwg19BYAFci1S05ekDkYUbd0wREXv8IIalp4TRGbK80wBgvEotL7vp7ePJm6lcthpz3SRuRuicUUnSPVbbv5baO6nt-6A4D0TKgLvrlOWTEWP3Zg3v6P6bA5C0go6u/s640/PartV.jpg&quot; width=&quot;80%&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
I will cover how we can populate the FlyoutAnchor control with its child elements on fly.&lt;br /&gt;
&lt;br /&gt;
I am going to use a custom PageComponent, Delegate Control and JavaScript file. To create PageComponent and Delegate control please refer my previous articles PartIII and PartIV.&lt;br /&gt;
&lt;br /&gt;
Here is XML declaration for FlyoutAnchor, I have dropped the other xml declaration to keep it simple.&lt;script class=&quot;brush: xml&quot; type=&quot;syntaxhighlighter&quot;&gt;
&lt;![CDATA[
              &lt;flyoutanchor Id=&quot;Ribbon.ListItem.Scorecard.New&quot;
                            Command=&quot;Ribbon.ListItem.Scorecard.New&quot;
                            Sequence=&quot;10&quot;
                            Image16by16=&quot;/_layouts/$Resources:core,Language;/images/ps16x16.png?vk=4514&quot;
                            Image16by16Top=&quot;-64&quot; Image16by16Left=&quot;-96&quot;
                            Image32by32=&quot;/_layouts/$Resources:core,Language;/images/ps32x32.png?vk=4514&quot;
                            Image32by32Top=&quot;-288&quot; Image32by32Left=&quot;-224&quot;
                            LabelText=&quot;New aQura&quot;
                            TemplateAlias=&quot;RowI&quot;
                            PopulateDynamically=&quot;true&quot;
                            PopulateOnlyOnce=&quot;true&quot;
                            PopulateQueryCommand=&quot;GetDynamicNewMenuXml&quot;
                            ToolTipTitle=&quot;&quot;
                            ToolTipDescription=&quot;&quot;/&gt;
]]&gt;
&lt;/script&gt; In this declaration you will notice that we have three new properties &lt;span style=&quot;font-family: Consolas; font-size: 9pt;&quot;&gt;&lt;span style=&quot;color: red;&quot;&gt;PopulateDynamically&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;true&lt;/span&gt;&quot;&lt;/span&gt;, &lt;span style=&quot;color: red;&quot;&gt;PopulateOnlyOnce&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;true&lt;/span&gt;&quot;&lt;/span&gt;, &lt;span style=&quot;color: red;&quot;&gt;PopulateQueryCommand&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;GetDynamicNewMenuXml&lt;/span&gt;&quot;&lt;/span&gt;. &lt;/span&gt;The important one is PopulateQueryCommand, this command gets executed when ribbon starts building this control. Within this event we will retrieve the required items which we want to show in FlyoutAnchor. Let&#39;s see how?&lt;br /&gt;
&lt;br /&gt;
Let&#39;s look into our PageComponent,&lt;script class=&quot;brush: javascript&quot; type=&quot;syntaxhighlighter&quot;&gt;
&lt;![CDATA[
    handleCommand: function (commandId, properties, sequence) {
        ULS_SP();
        if (commandId === &#39;GetDynamicNewMenuXml&#39;) {
            properties.PopulationXML = GetDynamicNewMenuXmlFunction();
            return true;
        }
        else {
            return handleCommand(commandId, properties, sequence);
        }
    }
]]&gt;
&lt;/script&gt; When PageComponent gets called as a result of PopulateQueryCommand in action, in handleCommand function one of its input parameter is &quot;properties&quot;. This has one method PopulationXML which takes the items declaration in the form of XML. When Ribbon found that this control has been set for dynamic population then it uses XML assigned to its properties. &lt;br /&gt;
On PopulateQueryCommand command we are calling GetDynamicNewMenuXmlFunction JavaScript function which will generates and returns the XML for menu.&lt;br /&gt;
&lt;br /&gt;
Here is GetDynamicNewMenuXmlFunction() code,&lt;br /&gt;
&lt;script class=&quot;brush: javascript&quot; type=&quot;syntaxhighlighter&quot;&gt;
&lt;![CDATA[
function GetDynamicNewMenuXmlFunction() {
    var $v_0 = new Sys.StringBuilder();
    $v_0.append(&#39;&lt;menu Id=\&#39;Ribbon.List.CustomViews.ModifyView.Menu\&#39;&gt;&#39;);
    $v_0.append(&#39;&lt;menusection DisplayMode=\&#39;Menu16\&#39; Id=\&#39;Ribbon.List.CustomViews.ModifyView.Menu.Manage\&#39;&gt;&#39;);
    $v_0.append(&#39;&lt;controls Id=\&#39;Ribbon.List.CustomViews.ModifyView.Menu.Manage.Controls\&#39;&gt;&#39;);
    $v_0.append(&#39;&lt;Button&#39;);
    $v_0.append(&#39; Id=\&#39;Ribbon.List.CustomViews.ModifyView.Menu.Manage.ModifyView\&#39;&#39;);
    $v_0.append(&#39; Command=\&#39;&#39;);
    $v_0.append(&#39;ModifyViewI&#39;);
    $v_0.append(&#39;\&#39;&#39;);
    $v_0.append(&#39; LabelText=\&#39;&#39;);
    $v_0.append(SP.Utilities.HttpUtility.htmlEncode(SP.Res.modifyViewLabel));
    $v_0.append(&#39;\&#39;&#39;);
    $v_0.append(&#39;/&gt;&#39;);
    $v_0.append(&#39;&lt;Button&#39;);
    $v_0.append(&#39; Id=\&#39;Ribbon.List.CustomViews.ModifyView.Menu.Manage.ModifyViewInDesigner\&#39;&#39;);
    $v_0.append(&#39; Command=\&#39;&#39;);
    $v_0.append(&#39;ModifyViewII&#39;);
    $v_0.append(&#39;\&#39;&#39;);
    $v_0.append(&#39; LabelText=\&#39;&#39;);
    $v_0.append(SP.Utilities.HttpUtility.htmlEncode(SP.Res.modifyInDesignerLabel));
    $v_0.append(&#39;\&#39;&#39;);
    $v_0.append(&#39;/&gt;&#39;);
    $v_0.append(&#39;&lt;/Controls&gt;&#39;);
    $v_0.append(&#39;&lt;/MenuSection&gt;&#39;);
    $v_0.append(&#39;&lt;/Menu&gt;&#39;);
    return $v_0.toString();
}
]]&gt;
&lt;/script&gt;The typical format of XML is ,&lt;br /&gt;
&lt;script class=&quot;brush: xml&quot; type=&quot;syntaxhighlighter&quot;&gt;
&lt;![CDATA[
&lt;menu Id =&quot;&quot;&gt;
  &lt;menusection Id =&quot;&quot;&gt;
    &lt;controls Id =&quot;&quot;&gt;
       &lt;button Command =&quot;&quot; Id =&quot;&quot; /&gt;
       ..... other controls declaration
     &lt;/Controls&gt;
  &lt;/MenuSection&gt;
&lt;/Menu&gt;
]]&gt;
&lt;/script&gt;For this example I have create menu string in JavaScript. You can generate it on fly in code behind and then inject it into page. Use Delegate Control for this purpose.&lt;br /&gt;
&lt;br /&gt;
I hope this will help you.&lt;br /&gt;
&lt;div&gt;
&lt;a href=&quot;http://sites.google.com/site/makarandsharepoint/mak/PartV.zip&quot;&gt;&lt;strong&gt;Download: Source Code&lt;/strong&gt;&lt;/a&gt; &lt;br /&gt;
&lt;strong&gt;Further Articles:&lt;/strong&gt; &lt;br /&gt;
I am going to explore more with ribbon and going to post all my findings with source code. So keep a track of below articles.&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://makarandrkulkarni.blogspot.com/2010/01/architecture-of-sharepoint-2010-ribbon.html&quot;&gt;SharePoint 2010 Ribbon Customization Part I: Architecture of Ribbon&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://makarandrkulkarni.blogspot.com/2010/01/sharepoint-2010-ribbon-customization.html&quot;&gt;SharePoint 2010 Ribbon Customization Part II: How to Add/Remove/Replace Tab Controls&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://makarandrkulkarni.blogspot.com/2010/01/sharepoint-2010-ribbon-customization_09.html&quot;&gt;SharePoint 2010 Ribbon Customization Part III: How to create Tab at various Locations?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://makarandrkulkarni.blogspot.com/2010/01/new-one.html&quot;&gt;SharePoint 2010 Ribbon Customization Part IV: How to add PostBack commands to ribbon?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://makarandrkulkarni.blogspot.com/2010/01/sharepoint-2010-ribbon-customization_5976.html&quot;&gt;SharePoint 2010 Ribbon Customization Part V: How to dynamically populate ribbon controls?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://makarandrkulkarni.blogspot.com/2010/01/sharepoint-2010-ribbon-customization_23.html&quot;&gt;SharePoint 2010 Ribbon Customization Part VI: How to enable/disable buttons in ribbon conditionally?&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://makarandrkulkarni.blogspot.com/feeds/2674313969767921022/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://makarandrkulkarni.blogspot.com/2010/01/sharepoint-2010-ribbon-customization_5976.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7021741417853834113/posts/default/2674313969767921022'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7021741417853834113/posts/default/2674313969767921022'/><link rel='alternate' type='text/html' href='http://makarandrkulkarni.blogspot.com/2010/01/sharepoint-2010-ribbon-customization_5976.html' title='SharePoint 2010 Ribbon Customization Part V: How to dynamically populate ribbon controls?'/><author><name>makarand Kulkarni</name><uri>http://www.blogger.com/profile/00881181707083196500</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiVI6aRDYOgSUmD0Gbwg19BYAFci1S05ekDkYUbd0wREXv8IIalp4TRGbK80wBgvEotL7vp7ePJm6lcthpz3SRuRuicUUnSPVbbv5baO6nt-6A4D0TKgLvrlOWTEWP3Zg3v6P6bA5C0go6u/s72-c/PartV.jpg" height="72" width="72"/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7021741417853834113.post-5543922716470444265</id><published>2010-01-23T12:44:00.041+05:30</published><updated>2011-02-07T19:06:38.803+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Ribbon Customization"/><category scheme="http://www.blogger.com/atom/ns#" term="SharePoint 2010"/><title type='text'>SharePoint 2010 Ribbon Customization Part VI: How to enable/disable buttons in ribbon conditionally?</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;style&gt;
.divI {
          
          scrollbar-face-color:#cccccc;
          scrollbar-shadow-color:#cccccc;
          scrollbar-highlight-color:#cccccc;
          scrollbar-3dlight-color:#130919;
          scrollbar-darkshadow-color:#130919;
          scrollbar-track-color:#cccccc;
          scrollbar-arrow-color:black;
          background-color: #cccccc;
          display:block;overflow:auto; position: relative; width:90%;height:400px
         }
&lt;/style&gt;&lt;span xmlns=&quot;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
In this article I will cover how we can enable and disable the controls from ribbon based on any specific column value. For an instance I have a list column &quot;State&quot;, if selected row is having status &quot;active&quot; then and then button should be enable in Ribbon, otherwise ribbon button should remain disable.&lt;br /&gt;
&lt;br /&gt;
For how to write Ribbon declaration please refer my previous articles.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;http://www.blogger.com/&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; cssfloat: left; float: left; margin-bottom: 1em; margin-right: 1em; width: 100%;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;137&quot; mt=&quot;true&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiG6TlBcQiPQqynlo1kMp-3ou-wx6rTNAeeO9LqJQyVZuS93Oskdf0sVjgkI3t0BX51FoHvOD96ch1ltzqAzWWUe-KK9ToEHPBU0ahqTLI8vEKwsn7nEWdHMGo7fNYzJBDtulQRKv6s_0yr/s640/PartVI-I.jpg&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
In above image you can see we have one button &quot;New&quot; in ribbon within group &quot;Console&quot;. Please refer the source code for Ribbon&#39;s declaration. We are going to use delegate control for injecting ECMA script on fly for desired list.&lt;br /&gt;
Below are the events causes ribbons to refresh so button can be turned enable/disable.&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Checkbox from every row&lt;/li&gt;
&lt;li&gt;SelectAll/DeselectAll checkbox from header row&lt;/li&gt;
&lt;li&gt;On every row select&lt;/li&gt;
&lt;/ul&gt;
On each of above events after executing their respective functionality they instruct the ribbon to refresh. On received of refresh event ribbon calls Enable script for each of its control. Enable Script is the attribute which points to JavaScript function which can contain the logic for deciding button to be enabled or disable. You can mention the JavaScript function name to Enable Script attribute while declaring the Ribbon XML element.&lt;br /&gt;
Now let&#39;s see how sample is going to work.&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;On page loads and when no row is selected button will be disable&lt;/li&gt;
&lt;li&gt;When user clicks checkbox of row and that row is having &quot;Active&quot; as status value then button will get enable&lt;/li&gt;
&lt;li&gt;When user clicks row and that row is having &quot;Active&quot; as status value then button will get enable&lt;/li&gt;
&lt;li&gt;If row is selected and button is enable and user click select all checkbox then ribbon will get refresh and button will be disable&lt;/li&gt;
&lt;/ul&gt;
So to achieve required functionality what we need is,&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;A function which will return a Boolean flag for ribbon to enable/disable button&lt;/li&gt;
&lt;li&gt;We need to attach our own events on row click, row checkbox click and header checkbox click &lt;/li&gt;
&lt;li&gt;So in our own functions we will retrieve the row and it&#39;s all cell values&lt;/li&gt;
&lt;li&gt;Based on status cell value we will set the global flag true/false.&lt;/li&gt;
&lt;li&gt;Then we will call Ribbon refresh, which eventually will enable/disable the button&lt;/li&gt;
&lt;/ul&gt;
Let&#39;s see how we can attach our own functions to various click events,&lt;br /&gt;
&lt;div style=&quot;align: center; display: block; height: 350px; overflow: auto; position: relative; width: 100%;&quot;&gt;
&lt;script class=&quot;brush: javascript&quot; type=&quot;syntaxhighlighter&quot;&gt;
&lt;![CDATA[
var _isButtonEnable = false;
var statusIndex = 2;
var row;

_spBodyOnLoadFunctionNames.push(&quot;registerEvents&quot;);

function isButtonEnablefn() {
    if (_isButtonEnable != &#39;undefined&#39;)
    { return _isButtonEnable } else
        return false;
}

function registerEvents() {
    var ctxCur = GetCurrentCtx();
    var SPGridViewGuid = ctxCur.listName;
    var oTables = document.getElementsByTagName(&quot;TABLE&quot;);
    for (var i = 0; i &lt; oTables.length; i++) {
        if (oTables[i].id != &quot;&quot;) {
            var listGUID = oTables[i].id.split(&quot;-{&quot;);
            if (listGUID[0] == SPGridViewGuid) {
                var oRows = oTables[i].getElementsByTagName(&quot;TR&quot;);

                var chkbxs = oRows[0].getElementsByTagName(&#39;input&#39;);
                if (chkbxs != null) {
                    chkbxs[0].attachEvent(&#39;onclick&#39;, selectAllClicked);
                }

                for (var j = 0; j &lt; oRows.length; j++) {
                    if (j != 0) {
                        oRows[j].attachEvent(&#39;onclick&#39;, rowClicked);
                        var chkbx = oRows[j].getElementsByTagName(&#39;input&#39;);
                        if (chkbx != null) {
                            chkbx[0].attachEvent(&#39;onclick&#39;, rowCbxClicked);
                        }
                    }
                }
            }
        }
    }
}

function selectAllClicked() {
    _isButtonEnable = false;
    RefreshCommandUI();
}

function rowClicked() {
    setSelectedItem();
}

function rowCbxClicked() {
    setSelectedItem();
}

function setSelectedItem() {
    var evt = null;
    //capture the curren event
    evt = window.event;
    //retrieve the source of event
    var o = GetEventSrcElement(evt);
    //if source element is ECB menu or link then return don&#39;t do anything
    if (o != null &amp;&amp; ElementContainsLink(o))
        return;
    // Close ECB menu if it is already open    
    if (clearECBMenu(o)) {
        CancelEvent(evt);
        return false;
    }
    //Retrieve the Row from which the event has raised
    var tr = GetItemRow(evt);
    var ctxCur = CtxFromRow(tr);

    if (CountSelectedItems(ctxCur) == 1) {
        var items = GetSelectedItemsDict(ctx);
        var k
        for (k in items) {
            var itm = items[k];
            //alert(&#39;List GUID :&#39; + ctxCur.listName + &#39;-- Item ID:&#39; + itm.id);
            // Keep selected row in backstore we will need this later on in ribbon events
            var curRow = saveCurrentRow(tr, itm.id);
            // If Row Item Status is Active then turn on New Button.
            (curRow.cells[statusIndex].outerText == SP.MyResource.Active) ? _isButtonEnable = true : _isButtonEnable = false;
        }
    }
    else { _isButtonEnable = false; }
    RefreshCommandUI();
}

function saveCurrentRow(tr, curSelectedItemId) {
    var tab = tr;
    while (tab.tagName != &quot;TABLE&quot;)
        tab = tab.parentNode;
    var rows = tab.rows;
    var i = 0;
    //This loop will fix the index for Phase State
    for (i = 0; i &lt; tab.cells.length; i++) {
        if (tab.cells[i].outerText.trim() == SP.MyResource.State.trim()) {
            statusIndex = i;
            break;
        }
    }
    var iid;
    var rgiid;
    //This loop will fix the current selected row
    for (i = 1; i &lt;= rows.length; i++) {
        iid = rows[i].getAttribute(&quot;iid&quot;);
        rgiid = iid.split(&quot;,&quot;);
        if (rgiid[1] == curSelectedItemId) {
            if (typeof (row) == &quot;undefined&quot;) row = [];
            row[curSelectedItemId.id] = rows[i];
            return rows[i];
        }
    }
    return null;
}

function NewButtonClick() {
    var url;
    var ctxCur = GetCurrentCtx();
    if (CountSelectedItems(ctxCur) == 1) {
        var items = GetSelectedItemsDict(ctx);
        var item
        for (item in items) {
            var itm = items[item];
            alert(&#39;List GUID :&#39; + ctxCur.listName + &#39;-- Item ID:&#39; + itm.id);
        }
    }
}

// javaScript String object&#39;s extension method for trim operation
String.prototype.trim = function () {
    return this.replace(/^\s*/, &quot;&quot;).replace(/\s*$/, &quot;&quot;);
}
]]&gt;
&lt;/script&gt;&lt;/div&gt;
&lt;br /&gt;
This is one of the core functions from this implementation. The final HTML of any ListViewWebPart is table and its id is always in the form of {ListGuid}-{WebPartGuid}. So this function retrieves all Html tables from the page and hooks the exact table based on ListGuid. To compare Table id for list GUID we know in advance the list GUID. &lt;br /&gt;
&lt;br /&gt;
How we can do that? &lt;br /&gt;
&lt;br /&gt;
Buy looking into current context. Whenever page gets rendered current SPContext gets injected into page. That can be desterilize into JavaScript object by calling &lt;strong&gt;GetCurrentCtx()&lt;/strong&gt; function. You can find this function in &lt;strong&gt;Core.js&lt;/strong&gt; file. The context is having all information like current list, web application information, selected row items and so on. You can inspect contains of context by doing client side debugging. [Debugging through IE and Visual Studio is the handiest approach for this]&lt;br /&gt;
&lt;br /&gt;
Finally once you get the exact table then iterate through all its row and cell and attach the click events of Checkbox on each row, row and Checkbox of header row. So now we have function &lt;strong&gt;rowClicked&lt;/strong&gt; for every row select, function &lt;strong&gt;rowCbxClicked&lt;/strong&gt; for every checkbox of each row and &lt;strong&gt;selectAllClicked&lt;/strong&gt; for header row&#39;s checkbox.&lt;br /&gt;
&lt;br /&gt;
In &lt;strong&gt;selectAllClicked&lt;/strong&gt;() function we are setting _isButtonEnable to false because whenever Select/Deselect all checkbox gets clicked we want our button should be disable. One we done with this we will call &lt;strong&gt;RefreshCommandUI(), &lt;/strong&gt;this function again an intrinsic function from Microsoft&#39;s Js file suite. You can find this function in &lt;strong&gt;Core.Js &lt;/strong&gt;file. This function causes Ribbon to refresh herself, so eventually all EnableScript functions of ribbon buttons get called and hence our &lt;strong&gt;isButtonEnablefn&lt;/strong&gt; gets called. Which just return the _isButtonEnable. Since we have set this variables value to false our button gets disable.&lt;br /&gt;
&lt;br /&gt;
Now you have got an idea how to enable and disable ribbon button. &lt;span style=&quot;font-family: Wingdings;&quot;&gt;J&lt;/span&gt; It&#39;s really fun to work with Ribbon.&lt;br /&gt;
&lt;br /&gt;
Now let&#39;s see what we will do in &lt;strong&gt;rowClicked &amp;amp; rowCbxClicked &lt;/strong&gt;,&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;First retrieve the element that causes the event. &lt;/li&gt;
&lt;li&gt;Then check whether that element contains any link by calling another intrinsic function &lt;strong&gt;ElementContainsLink&lt;/strong&gt;(). If that element contains the link it means you have select the cell value which is having Hyperlink so we shouldn&#39;t do anything just allow Hyperlink to do its own work so we will return from that point.&lt;/li&gt;
&lt;li&gt;Then we will close the ECB menu if that is open on any of earlier action.&lt;/li&gt;
&lt;li&gt;Then we will call again an intrinsic function &lt;strong&gt;GetItemRow&lt;/strong&gt;() to get item row which causes this event. We need this row for our other calculations Why? We will see that in our next steps.&lt;/li&gt;
&lt;li&gt;Now time to get current context, so we will call an intrinsic function &lt;strong&gt;CtxFromRow&lt;/strong&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9pt;&quot;&gt;(), &lt;/span&gt;which will return us the current client context.&lt;/li&gt;
&lt;li&gt;As I told you earlier this client context keeps all information about current spcontext. Along with that it also keeps the information about selected rows. &lt;strong&gt;context.dictSel &lt;/strong&gt;is the&lt;strong&gt;&lt;br /&gt;&lt;/strong&gt;array which holds all selected row item information. There are two intrinsic functions &lt;strong&gt;CountSelectedItems&lt;/strong&gt; &amp;amp; &lt;strong&gt;GetSelectedItemsDict &lt;/strong&gt;which return the selected item count and selected items respectively.&lt;span style=&quot;font-family: Consolas; font-size: 9pt;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;At this point we have row which cause the event and selected item count. So if selected count is 1, then and then we will check the row&#39;s State value if that is &quot;Active&quot; then we will set the _isButtonEnable flag to true else we will set it to false.&lt;span style=&quot;font-family: Consolas; font-size: 9pt;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;Now we will call &lt;strong&gt;RefreshCommandUI() &lt;/strong&gt;which will fire the ribbon refresh event that causes to each ribbon button to fire their own EnableScript function. In our case that one is &lt;strong&gt;isButtonEnablefn.&lt;/strong&gt;&lt;span style=&quot;font-family: Consolas; font-size: 9pt;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;As we have set the flag true or false based on our business logic. The button will get enable or disable based upon the value of _isButtonEnable flag.&lt;span style=&quot;font-family: Consolas; font-size: 9pt;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;All intrinsic functions I have used in this method you will find that into Core.JS file.&lt;/li&gt;
&lt;/ul&gt;
&lt;em&gt;Note: Please create a custom list, add choice column with &quot;Active&quot; &amp;amp; &quot;Cancel&quot; values as i have shown in image above. So you can play with sample.&lt;/em&gt;&lt;br /&gt;
&lt;br /&gt;
I hope this will help you.&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;a href=&quot;http://sites.google.com/site/makarandsharepoint/mak/PartVI.zip&quot;&gt;&lt;strong&gt;Download: Source Code&lt;/strong&gt;&lt;/a&gt; &lt;br /&gt;
&lt;strong&gt;Further Articles:&lt;/strong&gt; &lt;br /&gt;
I am going to explore more with ribbon and going to post all my findings with source code. So keep a track of below articles.&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://makarandrkulkarni.blogspot.com/2010/01/architecture-of-sharepoint-2010-ribbon.html&quot;&gt;SharePoint 2010 Ribbon Customization Part I: Architecture of Ribbon&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://makarandrkulkarni.blogspot.com/2010/01/sharepoint-2010-ribbon-customization.html&quot;&gt;SharePoint 2010 Ribbon Customization Part II: How to Add/Remove/Replace Tab Controls&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://makarandrkulkarni.blogspot.com/2010/01/sharepoint-2010-ribbon-customization_09.html&quot;&gt;SharePoint 2010 Ribbon Customization Part III: How to create Tab at various Locations?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://makarandrkulkarni.blogspot.com/2010/01/new-one.html&quot;&gt;SharePoint 2010 Ribbon Customization Part IV: How to add PostBack commands to ribbon?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://makarandrkulkarni.blogspot.com/2010/01/sharepoint-2010-ribbon-customization_5976.html&quot;&gt;SharePoint 2010 Ribbon Customization Part V: How to dynamically populate ribbon controls?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://makarandrkulkarni.blogspot.com/2010/01/sharepoint-2010-ribbon-customization_23.html&quot;&gt;SharePoint 2010 Ribbon Customization Part VI: How to enable/disable buttons in ribbon conditionally?&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://makarandrkulkarni.blogspot.com/feeds/5543922716470444265/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://makarandrkulkarni.blogspot.com/2010/01/sharepoint-2010-ribbon-customization_23.html#comment-form' title='13 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7021741417853834113/posts/default/5543922716470444265'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7021741417853834113/posts/default/5543922716470444265'/><link rel='alternate' type='text/html' href='http://makarandrkulkarni.blogspot.com/2010/01/sharepoint-2010-ribbon-customization_23.html' title='SharePoint 2010 Ribbon Customization Part VI: How to enable/disable buttons in ribbon conditionally?'/><author><name>makarand Kulkarni</name><uri>http://www.blogger.com/profile/00881181707083196500</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiG6TlBcQiPQqynlo1kMp-3ou-wx6rTNAeeO9LqJQyVZuS93Oskdf0sVjgkI3t0BX51FoHvOD96ch1ltzqAzWWUe-KK9ToEHPBU0ahqTLI8vEKwsn7nEWdHMGo7fNYzJBDtulQRKv6s_0yr/s72-c/PartVI-I.jpg" height="72" width="72"/><thr:total>13</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7021741417853834113.post-1372586050015680089</id><published>2010-01-16T14:06:00.035+05:30</published><updated>2011-02-07T13:36:02.928+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Ribbon Customization"/><category scheme="http://www.blogger.com/atom/ns#" term="SharePoint 2010"/><title type='text'>SharePoint 2010 Ribbon Customization Part IV: How to add PostBack commands to ribbon?</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;span xmlns=&quot;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
In this article I will cover how we can add commands to the ribbon which raises PostBack events.&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;http://www.blogger.com/&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; cssfloat: left; float: left; margin-bottom: 1em; margin-right: 1em; width: 100%;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;144&quot; mt=&quot;true&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjrXQ1qxbajvhwizsfUC9_yAH2VxsiCUpIox7a_s_DsHWS3b5X4U_uH2r9PYfChRKfcAZICLaVx4h3lTxLtixhkRLTOjQ059JymYJRymlD3zRcONaF_tjTdKxoa54pA95oXnYxXJNsDXtgy/s640/PartIV-I.jpg&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
I have add a new Button &quot;New&quot; within group &quot;Console&quot; on Items Tab. Below is the XML declaration for it,&lt;br /&gt;
&lt;script class=&quot;brush: xml&quot; type=&quot;syntaxhighlighter&quot;&gt;
&lt;![CDATA[
  &lt;customaction Id=&quot;Ribbon.aQuraII&quot;
   Location=&quot;CommandUI.Ribbon.ListView&quot;
   RegistrationId=&quot;100&quot;
   RegistrationType=&quot;List&quot;&gt;
    &lt;commanduiextension&gt;
      &lt;commanduidefinitions&gt;
        &lt;CommandUIDefinition
          Location=&quot;Ribbon.ListItem.Groups._children&quot; &gt;
          &lt;Group
            Id=&quot;Ribbon.aQura.Tab.Console&quot;
            Sequence=&quot;61&quot;
            Description=&quot;&quot;
            Title=&quot;Console&quot;
            Command=&quot;Ribbon.aQura.Tab.Console&quot;
            Template=&quot;Ribbon.aQura.ConsoleTemplate&quot;&gt;
            &lt;controls Id=&quot;Ribbon.aQura.Tab.Console.Controls&quot; &gt;
              &lt;Button
                  Id=&quot;Ribbon.ListItem.Scorecard.New&quot;
                  Command=&quot;Ribbon.ListItem.Scorecard.New&quot;
                  Sequence=&quot;20&quot;
                  Image16by16=&quot;/_layouts/$Resources:core,Language;/images/ps16x16.png?vk=4514&quot;
                  Image16by16Top=&quot;-36&quot; Image16by16Left=&quot;0&quot;
                  Image32by32=&quot;/_layouts/$Resources:core,Language;/images/ps32x32.png?vk=4514&quot;
                  Image32by32Top=&quot;-32&quot; Image32by32Left=&quot;-64&quot;
                  LabelText=&quot;$Resources:ResourcePartIV,Ribbon_aQura_Tab_Console_New_LabelText&quot;
                  TemplateAlias=&quot;RowI&quot;
                  ToolTipTitle=&quot;$Resources:ResourcePartIV,Ribbon_aQura_Tab_Console_New_ToolTipTitle&quot;
                  ToolTipDescription=&quot;$Resources:ResourcePartIV,Ribbon_aQura_Tab_Console_ToolTipDescription&quot;/&gt;
            &lt;/Controls&gt;
          &lt;/Group&gt;
        &lt;/CommandUIDefinition&gt;
        &lt;commanduidefinition Location=&quot;Ribbon.Templates._children&quot; &gt;
          &lt;grouptemplate Id=&quot;Ribbon.aQura.ConsoleTemplate&quot;&gt;
            &lt;layout Title=&quot;aQuraLarge&quot; LayoutTitle=&quot;aQuraLarge&quot;&gt;
              &lt;section Alignment =&quot;Top&quot; Type=&quot;OneRow&quot;&gt;
                &lt;row&gt;
                  &lt;controlref DisplayMode =&quot;Large&quot; TemplateAlias=&quot;RowI&quot;/&gt;
                &lt;/Row&gt;
              &lt;/Section&gt;
            &lt;/Layout&gt;
          &lt;/GroupTemplate&gt;
        &lt;/CommandUIDefinition&gt;
        &lt;commanduidefinition Location=&quot;Ribbon.ListItem.Scaling._children&quot;&gt;
          &lt;maxsize Id=&quot;Ribbon.aQura.Tab.Console.Scaling.MaxSize&quot; Sequence=&quot;35&quot; GroupId=&quot;Ribbon.aQura.Tab.Console&quot;
                   Size=&quot;aQuraLarge&quot;/&gt;
        &lt;/CommandUIDefinition&gt;
      &lt;/CommandUIDefinitions&gt;
    &lt;/CommandUIExtension&gt;
  &lt;/CustomAction&gt;

  &lt;control Id=&quot;AdditionalPageHead&quot; ControlSrc=&quot;~/_controltemplates/partIV/RibbonDelegate.ascx&quot; Sequence=&quot;49&quot;/&gt;

]]&gt;
&lt;/script&gt;If you observe above XML carefully, then you will find that I haven&#39;t declared the CommandUIHandler element. So events will not be raised for this Control. If you deploy it as it is then you will see the Button is disable.&lt;br /&gt;
What we want to do is, we want a command for this button which will raise the events and that will PostBack the page. So let&#39;s add the Command Handler for that. To add Custom ECMA Script we have two options,&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Override the delegate control on the page&lt;/strong&gt;: AdditionPageHead delegate control can be used to insert custom ECMA script on page. This is the best customizable options we have. Wherein you can choose the desired list for which you want to apply this customization.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Put a web part on the page&lt;/strong&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;: &lt;/span&gt;This option is good when we have new/display and edit page for list or library or a web part page.&lt;/li&gt;
&lt;/ul&gt;
We will go with Delegate Control. &lt;br /&gt;
So let&#39;s add a user control &quot;RibbonDelegate&quot; to Solution and insert XML declaration. Note the Control element in above xml declaration, we have instructed the &quot;AdditionalPageHead&quot; to host our Control.&lt;br /&gt;
In &quot;RibbonDelegate&quot; control,&lt;script class=&quot;brush: csharp&quot; type=&quot;syntaxhighlighter&quot;&gt;
&lt;![CDATA[
        protected void Page_Load(object sender, EventArgs e)
        {
            // Create ribbon commands
            List&lt;iribboncommand&gt; commands = new List&lt;iribboncommand&gt;();
            commands.Add(new SPRibbonCommand(&quot;Ribbon.aQura.Tab.Console&quot;, &quot;&quot;));
            commands.Add(new SPRibbonPostBackCommand(&quot;Ribbon.ListItem.Scorecard.New&quot;, 
                                                            this, &quot;NewScorecard&quot;, null, &quot;true&quot;));

            // Register ribbon scripts
            SPRibbonScriptManager spRibbonScriptManager = new SPRibbonScriptManager();
            spRibbonScriptManager.RegisterGetCommandsFunction(this.Page, &quot;getGlobalCommands&quot;, commands);
            spRibbonScriptManager.RegisterCommandEnabledFunction(this.Page, &quot;canHandleCommand&quot;, commands);
            spRibbonScriptManager.RegisterHandleCommandFunction(this.Page, &quot;handleCommand&quot;, commands);
            
            //Register Ribbon Page Components
            CustomScriptManager.RegisterInitializeFunction(this, &quot;InitPageComponent&quot;, &quot;/_layouts/PartIV/&quot;, &quot;SP.Ribbon.Custom.UI.js&quot;, false, &quot;SP.Ribbon.Custom.UI.RibbonAppPageComponent.initialize()&quot;);

        }
]]&gt;
&lt;/script&gt; We have four types of command for ribbon &lt;strong&gt;SPRibbonPopulateQueryCommand&lt;/strong&gt;, &lt;strong&gt;SPRibbonQueryCommand&lt;/strong&gt;, &lt;strong&gt;SPRibbonCommand&lt;/strong&gt;, &lt;strong&gt;SPRibbonPostBackCommand&lt;/strong&gt; . We will use only SPRibbonCommand and SPRibbonPostbackCommand rest we will see in my next article where using this commands we will populate controls on fly.&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;As usual for Group we need command with no action. So I have taken SPRibbonCommand with second parameter empty. In case if you interested to fire any JavaScript function then second parameter of this object will be name of that JavaScript function.&lt;/li&gt;
&lt;li&gt;For New button we need to PostBack, so we will use SPRibbonPostBackCommand. When we use this object at the same time we also need to implement IPostBackEventHandler interface. So we can handle the post back event and rout the system flow to post backed method. Note that &quot;NewScorecard&quot; is the Post back command which we will use while handling PostBack event.&lt;/li&gt;
&lt;li&gt;SPRibbonScriptManager registers the JavaScript delegate functions for PageComponent. Second parameters of its methods are the name of JavaScript functions which we have mentioned in its Page Component. Later on we will see PageComponent in detail. &lt;/li&gt;
&lt;/ul&gt;
Now we are done with command declarations and Page Components. Now we need a PageComponent which will establish communication between Ribbon and Page. So let&#39;s go and declare the PageComponent.&lt;br /&gt;
Refer the &lt;strong&gt;SP.Ribbon.Custom.UI.js&lt;/strong&gt; file in sample code.&lt;br /&gt;
&lt;script class=&quot;brush: javascript&quot; type=&quot;syntaxhighlighter&quot;&gt;
&lt;![CDATA[
SP.Ribbon.Custom.UI.RibbonAppPageComponent.prototype = {
    getFocusedCommands: function () {
        ULS_SP();
        return [];
    },
    getGlobalCommands: function () {
        ULS_SP();
        return getGlobalCommands();
    },
    isFocusable: function () {
        ULS_SP();
        return true;
    },
    receiveFocus: function () {
        ULS_SP();
        return true;
    },
    yieldFocus: function () {
        ULS_SP();
        return true;
    },
    canHandleCommand: function (commandId) {
        ULS_SP();
        return canHandleCommand(commandId);
    },
    handleCommand: function (commandId, properties, sequence) {
        ULS_SP();
        return handleCommand(commandId, properties, sequence);
       
    }
}
]]&gt;
&lt;/script&gt;Is PageComponent&amp;nbsp;making you more confuse? So let&#39;s see how Ribbon communicates with page.&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;There is always a single instance of a PageManager for every page. It is defined in CUI.js file you can inspect the CUI.js file for CUI.Page.PageManager. Who holds the FocuManager(CUI.Page.FocusManager) , CommandDispatcher (CUI.Page.CommandDispatcher), UndoManager(CUI.Page.UndoManager) and other supporting objects. &lt;/li&gt;
&lt;li&gt;CommandDispatcher registers all commands for ribbon and keeps the track of PageComponent. When command receive to PageManager, PageManager handovers the command to CommandDispatcher then CommandDispatcher routs the command to appropriate PageComponent.&lt;/li&gt;
&lt;li&gt;PageComponent is the one who has actual implementation of commands. This is inherited by CUI.PageComponent. So Custom PageComponent should always follow the same class structure as CUI.PageComponent has.&lt;/li&gt;
&lt;/ul&gt;
Let&#39;s see the system flow of Button/command click,&lt;br /&gt;
First of all our PageComponent is registered with PageManager. PageManager has two methods &lt;strong&gt;addPageComponent&lt;/strong&gt;() and &lt;strong&gt;removePageComponent&lt;/strong&gt;() which takes care of registration of page component. All OOB page components you can find into &lt;strong&gt;SP.Ribbon.js&lt;/strong&gt; file.&lt;br /&gt;
&lt;br /&gt;
Button we used is of type &quot;CUI.Controls.Button&quot; and its base class is &quot;CUI.Control&quot;. You can find declaration for all Ribbon controls into CUI.js file. This file has all classes used to construct the Ribbon.&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;User clicks on New Button.&lt;/li&gt;
&lt;li&gt;OnClick event Button access its parent component, in this case it is a Group which is a type of &quot;CUI.Component&quot;&lt;/li&gt;
&lt;li&gt;Then it calls the components raiseCommandEvent() method and then this method propagate the event to Tab and finally tab handovers this command with all required command information to PageManager.&lt;/li&gt;
&lt;li&gt;Once PageManager receives the command, he passes that to CommandDispatcher along with registered PageComponents&lt;/li&gt;
&lt;li&gt;CommandDispatcher then pick up appropriate PageComponent using sequence number and pass that command to PageComponent&lt;/li&gt;
&lt;li&gt;PageComponent then calls method attached to command.&lt;/li&gt;
&lt;/ul&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
If everything sounds confusing then leave it. Just keep in mind that we always need a PageComponent whenever we declare commands using code behind.&lt;/div&gt;
So now we have defined the PageComponent for us lets register it.&lt;script class=&quot;brush: csharp&quot; type=&quot;syntaxhighlighter&quot;&gt;
&lt;![CDATA[
            //Register Ribbon Page Components
            CustomScriptManager.RegisterInitializeFunction(this, &quot;InitPageComponent&quot;, &quot;/_layouts/PartIV/&quot;,
                &quot;SP.Ribbon.Custom.UI.js&quot;, false, &quot;SP.Ribbon.Custom.UI.RibbonAppPageComponent.initialize()&quot;);
]]&gt;
&lt;/script&gt; Click event of New Button causes page to postback, when page gets postback our delegate controls gets loaded and there we handle the post back event. Handling post back event in user control is the same as we are doing with plain vanilla asp.net pages.&lt;br /&gt;
&lt;br /&gt;
Once you define a PageComponent, then you don&#39;t need to define it every time you create a new ribbon tab or control. You can use the same PageComponent across your application. All this looks very complicated at first time but once you become familiar with it you will feel very easy to have custom actions into ribbon for your application.&lt;br /&gt;
&lt;br /&gt;
Few Important JS files:&lt;strong&gt; SP.Ribbon.js, SP.Core.js, CUI.js, Core.js&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
I hope this will help you all.&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;a href=&quot;http://sites.google.com/site/makarandsharepoint/mak/PartIV.zip&quot;&gt;&lt;strong&gt;Download: Source Code&lt;/strong&gt;&lt;/a&gt; &lt;br /&gt;
&lt;strong&gt;Further Articles:&lt;/strong&gt; &lt;br /&gt;
I am going to explore more with ribbon and going to post all my findings with source code. So keep a track of below articles.&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://makarandrkulkarni.blogspot.com/2010/01/architecture-of-sharepoint-2010-ribbon.html&quot;&gt;SharePoint 2010 Ribbon Customization Part I: Architecture of Ribbon&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://makarandrkulkarni.blogspot.com/2010/01/sharepoint-2010-ribbon-customization.html&quot;&gt;SharePoint 2010 Ribbon Customization Part II: How to Add/Remove/Replace Tab Controls&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://makarandrkulkarni.blogspot.com/2010/01/sharepoint-2010-ribbon-customization_09.html&quot;&gt;SharePoint 2010 Ribbon Customization Part III: How to create Tab at various Locations?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://makarandrkulkarni.blogspot.com/2010/01/new-one.html&quot;&gt;SharePoint 2010 Ribbon Customization Part IV: How to add PostBack commands to ribbon?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://makarandrkulkarni.blogspot.com/2010/01/sharepoint-2010-ribbon-customization_5976.html&quot;&gt;SharePoint 2010 Ribbon Customization Part V: How to dynamically populate ribbon controls?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://makarandrkulkarni.blogspot.com/2010/01/sharepoint-2010-ribbon-customization_23.html&quot;&gt;SharePoint 2010 Ribbon Customization Part VI: How to enable/disable buttons in ribbon conditionally?&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://makarandrkulkarni.blogspot.com/feeds/1372586050015680089/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://makarandrkulkarni.blogspot.com/2010/01/new-one.html#comment-form' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7021741417853834113/posts/default/1372586050015680089'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7021741417853834113/posts/default/1372586050015680089'/><link rel='alternate' type='text/html' href='http://makarandrkulkarni.blogspot.com/2010/01/new-one.html' title='SharePoint 2010 Ribbon Customization Part IV: How to add PostBack commands to ribbon?'/><author><name>makarand Kulkarni</name><uri>http://www.blogger.com/profile/00881181707083196500</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjrXQ1qxbajvhwizsfUC9_yAH2VxsiCUpIox7a_s_DsHWS3b5X4U_uH2r9PYfChRKfcAZICLaVx4h3lTxLtixhkRLTOjQ059JymYJRymlD3zRcONaF_tjTdKxoa54pA95oXnYxXJNsDXtgy/s72-c/PartIV-I.jpg" height="72" width="72"/><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7021741417853834113.post-6051754066033769033</id><published>2010-01-09T19:29:00.110+05:30</published><updated>2011-02-04T17:02:56.363+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Ribbon Customization"/><category scheme="http://www.blogger.com/atom/ns#" term="SharePoint 2010"/><title type='text'>SharePoint 2010 Ribbon Customization Part III: How to add custom Contextual tabs into Ribbon?</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
In This Article I will cover how we can have custom contextual group tabs at various locations.&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhX9wbiKTBzfO22DJTVRo_qaIeWCLL6GYNpFltflSx0sSyJVpCBi4a6gOfJEfMPyuUteaLzU3bQtbBEs46vhnZ6ZFl5hjjjr5tNlmjvgrONul-0gyK5r0be3XDeB-fSnVeTebWOyLKISDXf/s1600/PartIII-III.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; cssfloat: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; h5=&quot;true&quot; height=&quot;300&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhX9wbiKTBzfO22DJTVRo_qaIeWCLL6GYNpFltflSx0sSyJVpCBi4a6gOfJEfMPyuUteaLzU3bQtbBEs46vhnZ6ZFl5hjjjr5tNlmjvgrONul-0gyK5r0be3XDeB-fSnVeTebWOyLKISDXf/s640/PartIII-III.jpg&quot; width=&quot;600&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
In above image you can see,&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;A new custom contextual Tab “aQura” with tab “2W Series”&lt;/li&gt;
&lt;li&gt;A custom tab “2W Series” has been added to default List’s contextual Tab “List Tools”&lt;/li&gt;
&lt;li&gt;A single tab “aQura” with contextual tab has been added to list view&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
So we can move custom tab at various locations on form. Let’s see how?&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;strong&gt;Custom Contextual Tab: &lt;/strong&gt;&lt;/div&gt;
&lt;script class=&quot;brush: xml&quot; type=&quot;syntaxhighlighter&quot;&gt;
&lt;![CDATA[
  &lt;!-- Here we are creating custom contextual tab --&gt;
  &lt;CustomAction
    Id=&quot;Ribbon.aQura&quot; Location=&quot;CommandUI.Ribbon.ListView&quot;
    RegistrationId=&quot;100&quot; RegistrationType=&quot;List&quot;&gt;
    &lt;commanduiextension&gt;
      &lt;commanduidefinitions&gt;
        &lt;commanduidefinition Location=&quot;Ribbon.ContextualTabs._children&quot;&gt;
          
          &lt;!--
          &quot;Ribbon.ContextualTabs._children&quot;, instructs the ribbon to insert following XML into Ribbon as a Contextual Tab.
          If we want to add/modify tab, in that case location value would be “Ribbon.Tabs”.--&gt;
          
          &lt;contextualgroup Id=&quot;Ribbon.aQuraContextualGroup&quot; Sequence=&quot;401&quot;
                           Color=&quot;Green&quot; Command=&quot;Ribbon.aQuraContextualGroup&quot;
                           ContextualGroupId=&quot;aQuraContextualGroup&quot; Title=&quot;aQura&quot;&gt;
            &lt;!-- 
            The ContextualGroup Element is used to add a contextual tab into ribbon.
            OOB ContextualTab are sequenced in multiples of 100 so do not sequence your tab in multiples of 100
            Color: you can configure your contextual tab with given default colors.
            If you mention the Command then do not forgot to create CommandUIHandler for it,
            otherwise your controls will be rendered as disable
            --&gt;
            
            &lt;tab Id=&quot;Ribbon.aQura.Tab&quot; Title=&quot;2W Series&quot;
                 Command=&quot;Ribbon.aQura.Tab&quot; Description=&quot;aQura Menu&quot;
                 Sequence=&quot;1001&quot; &gt;
              
              &lt;!--
              To keep it Simple i am removing below code,You can download the source code for the same.
              The Download Link is at the bottom of this article.--&gt;
              

            &lt;/Tab&gt;
          &lt;/ContextualGroup&gt;
        &lt;/CommandUIDefinition&gt;

        &lt;commanduidefinition Location=&quot;Ribbon.Templates._children&quot; &gt;
          &lt;grouptemplate Id=&quot;Ribbon.aQura.ConsoleTemplate&quot;&gt;
            &lt;layout Title=&quot;aQuraLarge&quot; LayoutTitle=&quot;aQuraLarge&quot;&gt;
              &lt;!-- ... --&gt;
            &lt;/Layout&gt;
          &lt;/GroupTemplate&gt;
        &lt;/CommandUIDefinition&gt;

      &lt;/CommandUIDefinitions&gt;
      &lt;commanduihandlers&gt;
        &lt;!-- ... --&gt;
      &lt;/CommandUIHandlers&gt;
    &lt;/CommandUIExtension&gt;
  &lt;/CustomAction&gt;
]]&gt;
&lt;/script&gt;&lt;br /&gt;
Behind the scene, CUI.RibbonBuilder and CUI.RibbonBuildOptions classes are responsible for initializing Ribbon on client side. After you deploy above configuration you won’t find any custom Contextual tab for your list. The reason is CUI.RibbonBuildOptions doesn’t populate its shownTabs &amp;amp; initiallyVisibleContextualGroups properties with proper values. They populated with default values. You can check these properties through page’s view source. How we can instruct ribbon that, this is a new Contextual Tab and you should show whenever page gets rendered? To do so we need to access Ribbon control from the context. Once we get the Object of current ribbon then we will set the New Contextual Tab and Its all child tabs.&lt;/div&gt;
To do so we have two options,&lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;Override a delegate control on the page.&lt;/li&gt;
&lt;li&gt;Put a Web Part on the page.&lt;/li&gt;
&lt;/ul&gt;
Replacing a delegate should be used when working with a document library or list. The AdditionalPageHead delegate can be used to host our custom user control. Within that user control, we will access the current ribbon object. Web Parts can be placed on the page and on load of that web part we can easily access the ribbon object. Up to a great extension this is very handy solution but in case of ListView form we do not have freedom to put webpart on that page. So I prefer Delegate Control.&lt;/div&gt;
&lt;script class=&quot;brush: xml&quot; type=&quot;syntaxhighlighter&quot;&gt;
&lt;![CDATA[
&lt;control Id=&quot;AdditionalPageHead&quot; ControlSrc=&quot;~/_controltemplates/PartIII/RibbonDelegate.ascx&quot; Sequence=&quot;49&quot;/&gt;
]]&gt;
&lt;/script&gt;&lt;/div&gt;
By adding control element into xml declaration of custom action we can instruct the OOB “AdditionalPageHead” delegate control to host our custom user control.&lt;/div&gt;
&lt;script class=&quot;brush: csharp&quot; type=&quot;syntaxhighlighter&quot;&gt;
&lt;![CDATA[
        protected void Page_Load(object sender, EventArgs e)
        {
            SPRibbon current = SPRibbon.GetCurrent(this.Page);
            // Here you can select the desired list/library to display your tabs.
            if (current != null)
            {   
                current.MakeTabAvailable(&quot;Ribbon.aQura.SingleTab&quot;);
                current.MakeTabAvailable(&quot;Ribbon.aQura.Tab&quot;);
                current.MakeContextualGroupInitiallyVisible(&quot;Ribbon.aQuraContextualGroup&quot;, string.Empty);
            }
        }
]]&gt;
&lt;/script&gt;&lt;br /&gt;
SPRibbon’s GetCurrent method returns the Ribbon object belonging to the page in context. Then by accessing &lt;strong&gt;MakTabAvailable&lt;/strong&gt; method we are instructing ribbon to insert mention tab while rendering. Then by accessing &lt;strong&gt;MakeContextualGroupInitiallyVisible&lt;/strong&gt; method we are instructing ribbon to make our custom Contextual group visible.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Adding Custom Tab to OOB ContextualTab:&lt;/strong&gt;&lt;/div&gt;
&lt;script class=&quot;brush: xml&quot; type=&quot;syntaxhighlighter&quot;&gt;
&lt;![CDATA[
  &lt;!-- Here we are inserting tab into OOB lists Contextual Tab Group--&gt;
  &lt;CustomAction
    Id=&quot;Ribbon.aQuraI&quot;
    Location=&quot;CommandUI.Ribbon.ListView&quot;
    RegistrationId=&quot;100&quot; RegistrationType=&quot;List&quot;
    GroupId=&quot;ListContextualGroup&quot; Sequence=&quot;401&quot; &gt;
    &lt;commanduiextension&gt;
      &lt;commanduidefinitions&gt;
        &lt;CommandUIDefinition
          Location=&quot;Ribbon.ListContextualGroup._children&quot; &gt;
          
          &lt;!--&quot;Ribbon.ListContextualGroup&quot; is the OOB contextual tab,This contains Ribbon.ListItem and Ribbon.List tab.
          ._children instructs ribbon to add following xml as tab Into ListContextualGroup.If we want to modify
          Library in same fashion then the location value would be &quot;Ribbon.LibraryContextualGroup._children&quot;.Go
          through the CMDUI.xml file to get other ContextualTab IDs.--&gt; 

          &lt;tab Id=&quot;Ribbon.aQuraI.Tab&quot; Title=&quot;2W Series&quot;
                Command=&quot;Ribbon.aQuraI.Tab&quot; Description=&quot;aQura Menu&quot;
                Sequence=&quot;1001&quot; &gt;

            &lt;!--
              To keep it Simple i am removing below code,You can download the source code for the same.
              The Download Link is at the bottom of this article.--&gt;

            
          &lt;/Tab&gt;
        &lt;/CommandUIDefinition&gt;        
      &lt;/CommandUIDefinitions&gt;
      &lt;commanduihandlers&gt;
        &lt;!-- ... --&gt;
      &lt;/CommandUIHandlers&gt;
    &lt;/CommandUIExtension&gt;
  &lt;/CustomAction&gt;  
]]&gt;
&lt;/script&gt;&lt;br /&gt;
&lt;strong&gt;Adding Custom Tab to ListView without any contextual tab:&lt;/strong&gt;&lt;br /&gt;
&lt;script class=&quot;brush: xml&quot; type=&quot;syntaxhighlighter&quot;&gt;
&lt;![CDATA[
  &lt;!-- Here we are inserting custom tab into ribbon without Contextual Tab group--&gt;
  &lt;CustomAction
    Id=&quot;Ribbon.aQuraIV&quot;
    Location=&quot;CommandUI.Ribbon&quot;
    Sequence=&quot;601&quot;&gt;
    &lt;commanduiextension&gt;
      &lt;commanduidefinitions&gt;
        &lt;CommandUIDefinition
          Location=&quot;Ribbon.Tabs._children&quot; &gt;
          &lt;tab Id=&quot;Ribbon.aQura.SingleTab&quot; Title=&quot;aQura&quot;
                Command=&quot;Ribbon.aQura.SingleTab&quot; Description=&quot;aQura Menu&quot;
                Sequence=&quot;1602&quot; &gt;

            &lt;!--
              To keep it Simple i am removing below code,You can download the source code for the same.
              The Download Link is at the bottom of this article.--&gt;
            
          &lt;/Tab&gt;
        &lt;/CommandUIDefinition&gt;
      &lt;/CommandUIDefinitions&gt;
      &lt;commanduihandlers&gt;
        &lt;!-- ... --&gt;
      &lt;/CommandUIHandlers&gt;
    &lt;/CommandUIExtension&gt;
  &lt;/CustomAction&gt;
]]&gt;
&lt;/script&gt;&lt;br /&gt;
That’s all, deploy the solution and see the results. You will see the tab has been added to list view form without any contextual tab. What I have changed is Location attribute of Custom Action. “&lt;strong&gt;CommandUI.Ribbon&lt;/strong&gt;” instructs that create a tab but its scope will be global. Also I have removed RegistrationID and RegistrationType attributes. By doing this now I have a global tab which neither bind to any list nor have any predefined location.&lt;br /&gt;
&lt;br /&gt;
Next I need to instruct that while rendering my list, Ribbon should have this tab. How I can achieve this? By overriding Delegate Control, I have explained how to override Delegate Control in one of the above topic. Below is the code we need into user control.&lt;br /&gt;
&lt;br /&gt;
&lt;script class=&quot;brush: csharp&quot; type=&quot;syntaxhighlighter&quot;&gt;
&lt;![CDATA[
        protected void Page_Load(object sender, EventArgs e)
        {
            SPRibbon current = SPRibbon.GetCurrent(this.Page);
            // Here you can select the desired list/library to display your tabs.
            if (current != null)
            {   
                current.MakeTabAvailable(&quot;Ribbon.aQura.Tab&quot;);
            }
        }
]]&gt;
&lt;/script&gt;&lt;span style=&quot;color: red;&quot;&gt;&lt;strong&gt;Note: While working on ribbon customization, keep deleting IE’s temporary files. Otherwise results will be unexpected.&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;a href=&quot;http://sites.google.com/site/makarandsharepoint/mak/PartIII.zip&quot;&gt;&lt;strong&gt;Download: Source Code&lt;/strong&gt;&lt;/a&gt; &lt;br /&gt;
&lt;strong&gt;Further Articles:&lt;/strong&gt; &lt;br /&gt;
I am going to explore more with ribbon and going to post all my findings with source code. So keep a track of below articles.&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://makarandrkulkarni.blogspot.com/2010/01/architecture-of-sharepoint-2010-ribbon.html&quot;&gt;SharePoint 2010 Ribbon Customization Part I: Architecture of Ribbon&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://makarandrkulkarni.blogspot.com/2010/01/sharepoint-2010-ribbon-customization.html&quot;&gt;SharePoint 2010 Ribbon Customization Part II: How to Add/Remove/Replace Tab Controls&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://makarandrkulkarni.blogspot.com/2010/01/sharepoint-2010-ribbon-customization_09.html&quot;&gt;SharePoint 2010 Ribbon Customization Part III: How to create Tab at various Locations?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://makarandrkulkarni.blogspot.com/2010/01/new-one.html&quot;&gt;SharePoint 2010 Ribbon Customization Part IV: How to add PostBack commands to ribbon?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://makarandrkulkarni.blogspot.com/2010/01/sharepoint-2010-ribbon-customization_5976.html&quot;&gt;SharePoint 2010 Ribbon Customization Part V: How to dynamically populate ribbon controls?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://makarandrkulkarni.blogspot.com/2010/01/sharepoint-2010-ribbon-customization_23.html&quot;&gt;SharePoint 2010 Ribbon Customization Part VI: How to enable/disable buttons in ribbon conditionally?&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://makarandrkulkarni.blogspot.com/feeds/6051754066033769033/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://makarandrkulkarni.blogspot.com/2010/01/sharepoint-2010-ribbon-customization_09.html#comment-form' title='9 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7021741417853834113/posts/default/6051754066033769033'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7021741417853834113/posts/default/6051754066033769033'/><link rel='alternate' type='text/html' href='http://makarandrkulkarni.blogspot.com/2010/01/sharepoint-2010-ribbon-customization_09.html' title='SharePoint 2010 Ribbon Customization Part III: How to add custom Contextual tabs into Ribbon?'/><author><name>makarand Kulkarni</name><uri>http://www.blogger.com/profile/00881181707083196500</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhX9wbiKTBzfO22DJTVRo_qaIeWCLL6GYNpFltflSx0sSyJVpCBi4a6gOfJEfMPyuUteaLzU3bQtbBEs46vhnZ6ZFl5hjjjr5tNlmjvgrONul-0gyK5r0be3XDeB-fSnVeTebWOyLKISDXf/s72-c/PartIII-III.jpg" height="72" width="72"/><thr:total>9</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7021741417853834113.post-5166640379761223450</id><published>2010-01-09T18:20:00.086+05:30</published><updated>2011-02-02T18:43:24.185+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Ribbon Customization"/><category scheme="http://www.blogger.com/atom/ns#" term="SharePoint 2010"/><title type='text'>SharePoint 2010 Ribbon Customization Part II: How to Add/Remove/Replace Tab Controls?</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
In This Article I will cover how we can customize Ribbon Tab controls by adding/removing and replacing control. &lt;br /&gt;
&lt;br /&gt;
OOB ListItem Tab, &lt;br /&gt;
&lt;table style=&quot;width: 100%;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjjrXBB6IUhD525RWfiYIrsxj0mn9PLpwWNTbLALgwHsvwoUktXjmLgMnX1I7Exy029gx4DEMl4yMlIL8vfu-JXc2Im2kLZ35krnumMRS8jSRjGlKhT5NJyRZEkhvR42u9K8pggawuKANbB/s1600/PartII-II.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; cssfloat: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img align=&quot;center&quot; border=&quot;0&quot; height=&quot;137&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjjrXBB6IUhD525RWfiYIrsxj0mn9PLpwWNTbLALgwHsvwoUktXjmLgMnX1I7Exy029gx4DEMl4yMlIL8vfu-JXc2Im2kLZ35krnumMRS8jSRjGlKhT5NJyRZEkhvR42u9K8pggawuKANbB/s640/PartII-II.jpg&quot; width=&quot;640&quot; /&gt;&lt;/a&gt; &lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
This article will show how we can,&lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;Add new Button Control to “New” group in above tab&lt;/li&gt;
&lt;li&gt;Replace the “Delete Item” button with new Button&lt;/li&gt;
&lt;li&gt;Hide the “WorkFlows” group&lt;/li&gt;
&lt;li&gt;Add new custom Group with new button&lt;/li&gt;
&lt;/ul&gt;
So targeted ListItem should look like,&lt;br /&gt;
&lt;table style=&quot;width: 100%;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgrE9uWRdnX9AygdimG7NuLj4UlX35s-udyYRRAGnpoyRx6iiSc9KD2WmJ9HlYbzoAW1lrf1RW0yiGxUbNKckTMuhw6eFD_RBIIes67dtU4ZO9B9MYHRNcsO_gTb46N0tuAZiyBHf1FyWxw/s1600/PartII-I.jpg&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; cssfloat: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;283&quot; s5=&quot;true&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgrE9uWRdnX9AygdimG7NuLj4UlX35s-udyYRRAGnpoyRx6iiSc9KD2WmJ9HlYbzoAW1lrf1RW0yiGxUbNKckTMuhw6eFD_RBIIes67dtU4ZO9B9MYHRNcsO_gTb46N0tuAZiyBHf1FyWxw/s640/PartII-I.jpg&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;strong&gt;Add new button to “New” group of ListItem Tab&lt;/strong&gt;&lt;script class=&quot;brush: xml&quot; type=&quot;syntaxhighlighter&quot;&gt;
&lt;![CDATA[
 &lt;!-- Add new button to “New” group of ListItem Tab--&gt;
        &lt;commanduidefinition Location =&quot;Ribbon.ListItem.New.Controls._children&quot;&gt;
          &lt;!--The Location on the CommandUIDefinition element defines where the controls will render.
          In this example, we reference the &quot;New&quot; group of ListItem Tab.
          The _children convention tells the ribbon to insert the following XML into the output while rendering the ribbon.
          In our case, we are inserting the &quot;Button&quot; element XML.--&gt;
          &lt;Button
              Id=&quot;Ribbon.ListItem.Scorecard.New&quot;
              Command=&quot;PartIII&quot;
              Sequence=&quot;21&quot;
              Image16by16=&quot;/_layouts/$Resources:core,Language;/images/ps16x16.png?vk=4514&quot;
              Image16by16Top=&quot;-36&quot; Image16by16Left=&quot;0&quot;
              Image32by32=&quot;/_layouts/$Resources:core,Language;/images/ps32x32.png?vk=4514&quot;
              Image32by32Top=&quot;-32&quot; Image32by32Left=&quot;-64&quot;
              LabelText=&quot;$Resources:PartIIResource,Ribbon_aQura_Tab_Console_New_LabelText&quot;
              TemplateAlias=&quot;o1&quot;
              ToolTipTitle=&quot;$Resources:PartIIResource,Ribbon_aQura_Tab_Console_New_ToolTipTitle&quot;
              ToolTipDescription=&quot;$Resources:PartIIResource,Ribbon_aQura_Tab_Console_ToolTipDescription&quot;
              /&gt;
        &lt;/CommandUIDefinition&gt;
]]&gt;
&lt;/script&gt; &lt;/div&gt;

&lt;strong&gt;Replace the OOB “Delete” button with new Button&lt;/strong&gt;
&lt;script type=&quot;syntaxhighlighter&quot; class=&quot;brush: xml&quot;&gt;&lt;![CDATA[
        &lt;!-- Replace the “Delete Item” button with new Button--&gt;
        &lt;CommandUIDefinition Location=&quot;Ribbon.ListItem.Manage.Delete&quot;&gt;
          &lt;!--The Location on the CommandUIDefinition element defines where the controls will render.
          In this example, we reference the &quot;Delete&quot; button from &quot;Manage&quot; group of ListItem Tab.
          Below &quot;Button&quot; element XML will replace the OOB Delete button.--&gt;
          &lt;Button
                Id=&quot;Ribbon.ListItem.Scorecard.ReplaceButton&quot;
                Sequence=&quot;50&quot;
                Command=&quot;PartIII&quot;
                Image16by16=&quot;/_layouts/$Resources:core,Language;/images/formatmap16x16.png?vk=4536&quot;
                            Image16by16Top=&quot;-224&quot; Image16by16Left=&quot;-160&quot;
                Image32by32=&quot;/_layouts/$Resources:core,Language;/images/formatmap32x32.png?vk=4536&quot;
                            Image32by32Top=&quot;-416&quot; Image32by32Left=&quot;-128&quot;
                LabelText=&quot;Replaced Delete Button&quot;
                ToolTipTitle=&quot;$Resources:core,cui_ButDeleteItem;&quot;
                ToolTipDescription=&quot;$Resources:core,cui_STT_ButDeleteItem;&quot;
                TemplateAlias=&quot;o2&quot;
              /&gt;
        &lt;/CommandUIDefinition&gt;
]]&gt;&lt;/script&gt;

&lt;Strong&gt;Hide the “WorkFlows” group&lt;/strong&gt;
&lt;script type=&quot;syntaxhighlighter&quot; class=&quot;brush: xml&quot;&gt;&lt;![CDATA[
  &lt;!-- Hide the “WorkFlows” group --&gt;
  &lt;CustomAction
   Id=&quot;RemoveRibbonButton&quot;
   Location=&quot;CommandUI.Ribbon.ListView&quot; RegistrationId=&quot;100&quot;
   RegistrationType=&quot;List&quot;&gt;
    &lt;CommandUIExtension&gt;
      &lt;CommandUIDefinitions&gt;
        &lt;CommandUIDefinition    Location=&quot;Ribbon.ListItem.Workflow&quot; /&gt;
        &lt;!--The Location on the CommandUIDefinition element defines where the controls will render.
          In this example, we reference the &quot;Workflow&quot; group of ListItem Tab.
          Rest part of XML declaration should be empty to hide referenced Location. --&gt;
      &lt;/CommandUIDefinitions&gt;
    &lt;/CommandUIExtension&gt;
  &lt;/CustomAction&gt;
]]&gt;&lt;/script&gt;


&lt;strong&gt;Add new custom Group with new button&lt;/strong&gt;
&lt;script type=&quot;syntaxhighlighter&quot; class=&quot;brush: xml&quot;&gt;&lt;![CDATA[
        &lt;!-- Add new Group with a Custom Button --&gt;
        &lt;CommandUIDefinition Location=&quot;Ribbon.ListItem.Groups._children&quot; &gt;
          &lt;!--The Location on the CommandUIDefinition element defines where the controls will render.
          In this example, we reference the &quot;Groups&quot; collection of ListItem Tab.
          The _children convention tells the ribbon to insert the following XML into the output while rendering the ribbon.
          In our case, we are inserting the &quot;Group&quot; element XML.--&gt;
          &lt;Group
            Id=&quot;Ribbon.aQura.Tab.Console&quot;
            Sequence=&quot;61&quot;
            Description=&quot;&quot;
            Title=&quot;Console&quot;
            Command=&quot;Ribbon.aQura.Tab.Console&quot;
            Template=&quot;Ribbon.aQura.ConsoleTemplate&quot;&gt;
            &lt;Controls Id=&quot;Ribbon.aQura.Tab.Console.Controls&quot; &gt;
              &lt;!-- The Controls element contains the controls that will render in the group --&gt;
              &lt;Button
                  Id=&quot;Ribbon.ListItem.Scorecard.New&quot;
                  Command=&quot;PartIII&quot;
                  Sequence=&quot;20&quot;
                  Image16by16=&quot;/_layouts/$Resources:core,Language;/images/ps16x16.png?vk=4514&quot;
                  Image16by16Top=&quot;-36&quot; Image16by16Left=&quot;0&quot;
                  Image32by32=&quot;/_layouts/$Resources:core,Language;/images/ps32x32.png?vk=4514&quot;
                  Image32by32Top=&quot;-32&quot; Image32by32Left=&quot;-64&quot;
                  LabelText=&quot;$Resources:PartIIResource,Ribbon_aQura_Tab_Console_New_LabelText&quot;
                  TemplateAlias=&quot;RowI&quot;
                  ToolTipTitle=&quot;$Resources:PartIIResource,Ribbon_aQura_Tab_Console_New_ToolTipTitle&quot;
                  ToolTipDescription=&quot;$Resources:PartIIResource,Ribbon_aQura_Tab_Console_ToolTipDescription&quot;/&gt;
            &lt;/Controls&gt;
          &lt;/Group&gt;
        &lt;/CommandUIDefinition&gt;
        &lt;!-- Console Group&#39;s Template --&gt;
        &lt;CommandUIDefinition Location=&quot;Ribbon.Templates._children&quot; &gt;
          &lt;GroupTemplate Id=&quot;Ribbon.aQura.ConsoleTemplate&quot;&gt;
            &lt;Layout Title=&quot;aQuraLarge&quot; LayoutTitle=&quot;aQuraLarge&quot;&gt;
              &lt;Section Alignment =&quot;Top&quot; Type=&quot;OneRow&quot;&gt;
                &lt;Row&gt;
                  &lt;ControlRef DisplayMode =&quot;Large&quot; TemplateAlias=&quot;RowI&quot;/&gt;
                &lt;/Row&gt;
              &lt;/Section&gt;
            &lt;/Layout&gt;
          &lt;/GroupTemplate&gt;
        &lt;/CommandUIDefinition&gt;
        &lt;CommandUIDefinition Location=&quot;Ribbon.ListItem.Scaling._children&quot;&gt;
          &lt;MaxSize Id=&quot;Ribbon.aQura.Tab.Console.Scaling.MaxSize&quot; Sequence=&quot;35&quot; 
                   GroupId=&quot;Ribbon.aQura.Tab.Console&quot; Size=&quot;aQuraLarge&quot;/&gt;
        &lt;/CommandUIDefinition&gt;
      &lt;/CommandUIDefinitions&gt;
      &lt;!-- 
      - Command Handlers -
      The CommandUIHandlers element contains all of the CommandUIHandler elements.
      The CommandUIHandler elements define how controls on the ribbon respond to an action.--&gt;
      &lt;CommandUIHandlers&gt;
        &lt;CommandUIHandler
          Command=&quot;PartIII&quot;
          CommandAction=&quot;javascript:alert(&#39;Ribbon Customization for add/Delete/replace button controls&#39;);&quot; /&gt;
        &lt;CommandUIHandler
          Command=&quot;Ribbon.aQura.Tab.Console&quot;
          CommandAction=&quot;javascript:alert(&#39;Ribbon Customization for add/Delete/replace button controls&#39;);&quot; /&gt;
      &lt;/CommandUIHandlers&gt;
]]&gt;&lt;/script&gt;


&lt;div&gt;

&lt;a href=&quot;http://sites.google.com/site/makarandsharepoint/mak/PartII.zip&quot;&gt;&lt;strong&gt;Download: Source Code&lt;/strong&gt;&lt;/a&gt;
&lt;br /&gt;
&lt;strong&gt;Further Articles:&lt;/strong&gt; &lt;br /&gt;
I am going to explore more with ribbon and going to post all my findings with source code. So keep a track of below articles.&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://makarandrkulkarni.blogspot.com/2010/01/architecture-of-sharepoint-2010-ribbon.html&quot;&gt;SharePoint 2010 Ribbon Customization Part I: Architecture of Ribbon&lt;/a&gt;&lt;br /&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://makarandrkulkarni.blogspot.com/2010/01/sharepoint-2010-ribbon-customization.html&quot;&gt;SharePoint 2010 Ribbon Customization Part II: How to Add/Remove/Replace Tab Controls&lt;/a&gt;&lt;br /&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://makarandrkulkarni.blogspot.com/2010/01/sharepoint-2010-ribbon-customization_09.html&quot;&gt;SharePoint 2010 Ribbon Customization Part III: How to create Tab at various Locations?&lt;/a&gt;&lt;br /&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://makarandrkulkarni.blogspot.com/2010/01/new-one.html&quot;&gt;SharePoint 2010 Ribbon Customization Part IV: How to add PostBack commands to ribbon?&lt;/a&gt;&lt;br /&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://makarandrkulkarni.blogspot.com/2010/01/sharepoint-2010-ribbon-customization_5976.html&quot;&gt;SharePoint 2010 Ribbon Customization Part V: How to dynamically populate ribbon controls?&lt;/a&gt;&lt;br /&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://makarandrkulkarni.blogspot.com/2010/01/sharepoint-2010-ribbon-customization_23.html&quot;&gt;SharePoint 2010 Ribbon Customization Part VI: How to enable/disable buttons in ribbon conditionally?&lt;/a&gt;&lt;br /&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://makarandrkulkarni.blogspot.com/feeds/5166640379761223450/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://makarandrkulkarni.blogspot.com/2010/01/sharepoint-2010-ribbon-customization.html#comment-form' title='7 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7021741417853834113/posts/default/5166640379761223450'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7021741417853834113/posts/default/5166640379761223450'/><link rel='alternate' type='text/html' href='http://makarandrkulkarni.blogspot.com/2010/01/sharepoint-2010-ribbon-customization.html' title='SharePoint 2010 Ribbon Customization Part II: How to Add/Remove/Replace Tab Controls?'/><author><name>makarand Kulkarni</name><uri>http://www.blogger.com/profile/00881181707083196500</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjjrXBB6IUhD525RWfiYIrsxj0mn9PLpwWNTbLALgwHsvwoUktXjmLgMnX1I7Exy029gx4DEMl4yMlIL8vfu-JXc2Im2kLZ35krnumMRS8jSRjGlKhT5NJyRZEkhvR42u9K8pggawuKANbB/s72-c/PartII-II.jpg" height="72" width="72"/><thr:total>7</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7021741417853834113.post-6502334938617141647</id><published>2010-01-02T16:51:00.069+05:30</published><updated>2011-02-02T18:42:51.034+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="Ribbon Customization"/><category scheme="http://www.blogger.com/atom/ns#" term="SharePoint 2010"/><title type='text'>SharePoint 2010 Ribbon Customization Part I: Architecture of Ribbon</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
In This article I will cover the architecture of Ribbon control. Tabs appear across the top of the page in SharePoint 2010 sites. Top element of Ribbon is Tab. The Ribbon is defined using xml in a Feature manifest or as a Custom Action.&lt;br /&gt;
What Ribbon Contains?&lt;br /&gt;
To see ribbon’s internal you need to look into CMDUI.xml file, which you can find at &lt;strong&gt;location 14\template\global\xml\cmdui.xml.&lt;/strong&gt; &lt;br /&gt; &lt;/br&gt;

&lt;b&gt;Ribbon Control’s skeleton,&lt;/b&gt;&lt;/br&gt;
&lt;script type=&quot;syntaxhighlighter&quot; class=&quot;brush: xml&quot;&gt;&lt;![CDATA[
&lt;CommandUI xmlns=&quot;http://schemas.microsoft.com/sharepoint/&quot;&gt;
  &lt;Ribbon Id=&quot;&quot;&gt;
    &lt;Tabs Id=&quot;Ribbon.Tabs&quot;&gt;
      &lt;Tab&gt;
        &lt;Scaling&gt;&lt;/Scaling&gt;
        &lt;Groups&gt;
          &lt;Group&gt;
            &lt;Controls&gt;&lt;/Controls&gt;
          &lt;/Group&gt;
        &lt;/Groups&gt;
      &lt;/Tab&gt;
    &lt;/Tabs&gt;
    &lt;ContextualTabs Id=&quot;Ribbon.ContextualTabs&quot;&gt;
      &lt;ContextualGroup&gt;
        &lt;Tab&gt;&lt;/Tab&gt;
      &lt;/ContextualGroup&gt;
    &lt;/ContextualTabs&gt;
  &lt;/Ribbon&gt;
  &lt;Templates&gt;
    &lt;RibbonTemplates Id=&quot;Ribbon.Templates&quot;&gt;
      &lt;GroupTemplate&gt;&lt;/GroupTemplate&gt;
    &lt;/RibbonTemplates&gt;
  &lt;/Templates&gt;
&lt;/CommandUI&gt;
]]&gt;&lt;/script&gt; 

&lt;/br&gt;

&lt;table class=MsoTableGrid border=1 cellspacing=0 cellpadding=0 width=&quot;100%&quot;
 style=&#39;width:100.0%;border-collapse:collapse;border:none;mso-border-alt:solid windowtext .5pt;
 mso-yfti-tbllook:1184;mso-padding-alt:0in 5.4pt 0in 5.4pt&#39;&gt;
 &lt;tr style=&#39;mso-yfti-irow:0;mso-yfti-firstrow:yes&#39;&gt;
  &lt;td width=958 colspan=2 valign=top style=&#39;width:6.65in;border:solid windowtext 1.0pt;
  mso-border-alt:solid windowtext .5pt;background:#002060;padding:0in 5.4pt 0in 5.4pt&#39;&gt;
  &lt;p class=MsoNormal style=&#39;margin-bottom:0in;margin-bottom:.0001pt;line-height:
  normal;background:navy&#39;&gt;&lt;b&gt;&lt;span style=&#39;font-family:&quot;Verdana&quot;,&quot;sans-serif&quot;;
  mso-fareast-font-family:&quot;Times New Roman&quot;;mso-bidi-font-family:&quot;Courier New&quot;;
  color:white&#39;&gt;Ribbon Objects&lt;/span&gt;&lt;/b&gt;&lt;span style=&#39;color:white;mso-themecolor:
  background1&#39;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
  &lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr style=&#39;mso-yfti-irow:1&#39;&gt;
  &lt;td width=218 valign=top style=&#39;width:108.9pt;border:solid windowtext 1.0pt;
  border-top:none;mso-border-top-alt:solid windowtext .5pt;mso-border-alt:solid windowtext .5pt;
  padding:0in 5.4pt 0in 5.4pt&#39;&gt;
  &lt;p class=MsoNormal style=&#39;margin-bottom:0in;margin-bottom:.0001pt;line-height:
  normal&#39;&gt;&lt;span class=SpellE&gt;CommandUI&lt;/span&gt;&lt;/p&gt;
  &lt;/td&gt;
  &lt;td width=740 valign=top style=&#39;width:369.9pt;border-top:none;border-left:
  none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
  mso-border-top-alt:solid windowtext .5pt;mso-border-left-alt:solid windowtext .5pt;
  mso-border-alt:solid windowtext .5pt;padding:0in 5.4pt 0in 5.4pt&#39;&gt;
  &lt;p class=MsoNormal style=&#39;margin-bottom:0in;margin-bottom:.0001pt;line-height:
  normal&#39;&gt;Starting point for Ribbon which points to the namespace &lt;span
  style=&#39;font-size:9.5pt;font-family:Consolas;color:blue&#39;&gt;http://schemas.microsoft.com/sharepoint/&lt;/span&gt;&lt;span
  style=&#39;font-size:9.5pt;font-family:Consolas&#39;&gt;&amp;quot;&lt;/span&gt;&lt;/p&gt;
  &lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr style=&#39;mso-yfti-irow:2&#39;&gt;
  &lt;td width=218 valign=top style=&#39;width:108.9pt;border:solid windowtext 1.0pt;
  border-top:none;mso-border-top-alt:solid windowtext .5pt;mso-border-alt:solid windowtext .5pt;
  padding:0in 5.4pt 0in 5.4pt&#39;&gt;
  &lt;p class=MsoNormal style=&#39;margin-bottom:0in;margin-bottom:.0001pt;line-height:
  normal&#39;&gt;Ribbon&lt;/p&gt;
  &lt;/td&gt;
  &lt;td width=740 valign=top style=&#39;width:369.9pt;border-top:none;border-left:
  none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
  mso-border-top-alt:solid windowtext .5pt;mso-border-left-alt:solid windowtext .5pt;
  mso-border-alt:solid windowtext .5pt;padding:0in 5.4pt 0in 5.4pt&#39;&gt;
  &lt;p class=MsoNormal style=&#39;margin-bottom:0in;margin-bottom:.0001pt;line-height:
  normal&#39;&gt;Represents OOB ribbon control. SharePoint 2010 has only one instance
  of Ribbon control per page. Ribbon control by default configured with all OOB
  Contextual Tabs, Tabs and Templates. At runtime ribbon gets trimmed for
  non-required tabs and shows only relevant tabs. &lt;span class=GramE&gt;e.g&lt;/span&gt;.
  While rendering any List only “List Tools” contextual tab gets rendered, rest
  all tabs gets trimmed. &lt;/p&gt;
  &lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr style=&#39;mso-yfti-irow:3&#39;&gt;
  &lt;td width=218 valign=top style=&#39;width:108.9pt;border:solid windowtext 1.0pt;
  border-top:none;mso-border-top-alt:solid windowtext .5pt;mso-border-alt:solid windowtext .5pt;
  padding:0in 5.4pt 0in 5.4pt&#39;&gt;
  &lt;p class=MsoNormal style=&#39;margin-bottom:0in;margin-bottom:.0001pt;line-height:
  normal&#39;&gt;Tabs&lt;/p&gt;
  &lt;/td&gt;
  &lt;td width=740 valign=top style=&#39;width:369.9pt;border-top:none;border-left:
  none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
  mso-border-top-alt:solid windowtext .5pt;mso-border-left-alt:solid windowtext .5pt;
  mso-border-alt:solid windowtext .5pt;padding:0in 5.4pt 0in 5.4pt&#39;&gt;
  &lt;p class=MsoNormal style=&#39;margin-bottom:0in;margin-bottom:.0001pt;line-height:
  normal&#39;&gt;It is a collection of all tabs. Its ID is &lt;span style=&#39;font-size:
  9.5pt;font-family:Consolas&#39;&gt;&amp;quot;&lt;span class=SpellE&gt;&lt;span style=&#39;color:blue&#39;&gt;Ribbon.Tabs&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&amp;quot;.
  Whenever we want to add new tab to ribbon then we have refer this collection.
  We have to instruct ribbon to insert custom tab into Tabs collection. To
  instruct ribbon to insert tab into its collection we need to use &lt;b
  style=&#39;mso-bidi-font-weight:normal&#39;&gt;Location&lt;/b&gt; attribute and have to give
  value as “&lt;span class=SpellE&gt;&lt;span style=&#39;font-size:9.5pt;font-family:Consolas;
  color:blue&#39;&gt;Ribbon.Tabs._children&lt;/span&gt;&lt;/span&gt;”.&lt;/p&gt;
  &lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr style=&#39;mso-yfti-irow:4&#39;&gt;
  &lt;td width=218 rowspan=5 valign=top style=&#39;width:108.9pt;border:solid windowtext 1.0pt;
  border-top:none;mso-border-top-alt:solid windowtext .5pt;mso-border-alt:solid windowtext .5pt;
  padding:0in 5.4pt 0in 5.4pt&#39;&gt;
  &lt;p class=MsoNormal style=&#39;margin-bottom:0in;margin-bottom:.0001pt;line-height:
  normal&#39;&gt;Tab&lt;/p&gt;
  &lt;/td&gt;
  &lt;td width=740 valign=top style=&#39;width:369.9pt;border-top:none;border-left:
  none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
  mso-border-top-alt:solid windowtext .5pt;mso-border-left-alt:solid windowtext .5pt;
  mso-border-alt:solid windowtext .5pt;padding:0in 5.4pt 0in 5.4pt&#39;&gt;
  &lt;p class=MsoNormal style=&#39;margin-bottom:0in;margin-bottom:.0001pt;line-height:
  normal&#39;&gt;This represents a single tab for a ribbon or Contextual Tabs. We can have
  custom tab on New/Edit/Display/&lt;span class=SpellE&gt;ListView&lt;/span&gt; forms.&lt;/p&gt;
  &lt;p class=MsoNormal style=&#39;margin-bottom:0in;margin-bottom:.0001pt;line-height:
  normal&#39;&gt;Tab acts like a container and contains controls which can raise the
  events on client side and server side. Following are the child objects of
  tab. &lt;/p&gt;
  &lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr style=&#39;mso-yfti-irow:5&#39;&gt;
  &lt;td width=740 valign=top style=&#39;width:369.9pt;border-top:none;border-left:
  none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
  mso-border-top-alt:solid windowtext .5pt;mso-border-left-alt:solid windowtext .5pt;
  mso-border-alt:solid windowtext .5pt;padding:0in 5.4pt 0in 5.4pt&#39;&gt;
  &lt;p class=MsoNormal style=&#39;margin-bottom:0in;margin-bottom:.0001pt;line-height:
  normal&#39;&gt;&lt;b style=&#39;mso-bidi-font-weight:normal&#39;&gt;Scaling&lt;/b&gt;: this element
  decides how the controls get rendered and scale at runtime. It has two more child
  elements, &lt;/p&gt;
  &lt;p class=MsoListParagraphCxSpFirst style=&#39;margin-bottom:0in;margin-bottom:
  .0001pt;mso-add-space:auto;text-indent:-.25in;line-height:normal;mso-list:
  l11 level1 lfo8&#39;&gt;&lt;![if !supportLists]&gt;&lt;span style=&#39;font-family:Symbol;
  mso-fareast-font-family:Symbol;mso-bidi-font-family:Symbol&#39;&gt;&lt;span
  style=&#39;mso-list:Ignore&#39;&gt;·&lt;span style=&#39;font:7.0pt &quot;Times New Roman&quot;&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
  &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;![endif]&gt;&lt;span class=SpellE&gt;MaxSize&lt;/span&gt;: controls
  the max size of control on tab.&lt;/p&gt;
  &lt;p class=MsoListParagraphCxSpLast style=&#39;margin-bottom:0in;margin-bottom:
  .0001pt;mso-add-space:auto;text-indent:-.25in;line-height:normal;mso-list:
  l11 level1 lfo8&#39;&gt;&lt;![if !supportLists]&gt;&lt;span style=&#39;font-family:Symbol;
  mso-fareast-font-family:Symbol;mso-bidi-font-family:Symbol&#39;&gt;&lt;span
  style=&#39;mso-list:Ignore&#39;&gt;·&lt;span style=&#39;font:7.0pt &quot;Times New Roman&quot;&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
  &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;![endif]&gt;Scale: handles the scaling for controls.&lt;/p&gt;
  &lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr style=&#39;mso-yfti-irow:6&#39;&gt;
  &lt;td width=740 valign=top style=&#39;width:369.9pt;border-top:none;border-left:
  none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
  mso-border-top-alt:solid windowtext .5pt;mso-border-left-alt:solid windowtext .5pt;
  mso-border-alt:solid windowtext .5pt;padding:0in 5.4pt 0in 5.4pt&#39;&gt;
  &lt;p class=MsoNormal style=&#39;margin-bottom:0in;margin-bottom:.0001pt;line-height:
  normal&#39;&gt;&lt;b style=&#39;mso-bidi-font-weight:normal&#39;&gt;Groups&lt;/b&gt;: It is a collection
  of group(s). We can add custom group to any tab. To do so we need to instruct
  ribbon to insert defined xml as a groups into tab. &lt;b style=&#39;mso-bidi-font-weight:
  normal&#39;&gt;Location&lt;/b&gt; attribute needs to be properly configured and acceptable
  value for that is “&lt;span class=SpellE&gt;&lt;span style=&#39;font-size:9.5pt;
  font-family:Consolas;color:blue&#39;&gt;Ribbon.Tabs.Groups._children&lt;/span&gt;&lt;/span&gt;”.&lt;/p&gt;
  &lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr style=&#39;mso-yfti-irow:7&#39;&gt;
  &lt;td width=740 valign=top style=&#39;width:369.9pt;border-top:none;border-left:
  none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
  mso-border-top-alt:solid windowtext .5pt;mso-border-left-alt:solid windowtext .5pt;
  mso-border-alt:solid windowtext .5pt;padding:0in 5.4pt 0in 5.4pt&#39;&gt;
  &lt;p class=MsoNormal style=&#39;margin-bottom:0in;margin-bottom:.0001pt;line-height:
  normal&#39;&gt;&lt;b style=&#39;mso-bidi-font-weight:normal&#39;&gt;Group&lt;/b&gt;: It groups the
  various control into one entity. It has a child element “Controls” which
  contains the declaration for various controls. &lt;span
  style=&#39;mso-spacerun:yes&#39;&gt; &lt;/span&gt;Every Group is binded to Template and this
  template decides the layout for that group. We can customize the Group
  elements. We can add, remove and replace the control from a group. For that,
  we need to configure Location attribute properly. The standard formula is, “&lt;span
  style=&#39;font-size:9.5pt;font-family:Consolas;color:blue&#39;&gt;Ribbon&lt;span
  class=GramE&gt;.[&lt;/span&gt;Tab].[Group].&lt;span class=SpellE&gt;Controls_children&lt;/span&gt;&lt;/span&gt;”.
  For an instance for List’s &lt;span class=SpellE&gt;ListItem&lt;/span&gt; tab if you want
  to insert new control in its Manage group then the location value would be “&lt;span
  class=SpellE&gt;&lt;span style=&#39;font-size:9.5pt;font-family:Consolas;color:blue&#39;&gt;Ribbon.ListItem.Manage.Controls._children&lt;/span&gt;&lt;/span&gt;”.&lt;/p&gt;
  &lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr style=&#39;mso-yfti-irow:8&#39;&gt;
  &lt;td width=740 valign=top style=&#39;width:369.9pt;border-top:none;border-left:
  none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
  mso-border-top-alt:solid windowtext .5pt;mso-border-left-alt:solid windowtext .5pt;
  mso-border-alt:solid windowtext .5pt;padding:0in 5.4pt 0in 5.4pt&#39;&gt;
  &lt;p class=MsoNormal style=&#39;margin-bottom:0in;margin-bottom:.0001pt;line-height:
  normal&#39;&gt;&lt;b style=&#39;mso-bidi-font-weight:normal&#39;&gt;Controls&lt;/b&gt;: Allowable
  controls in Groups are &lt;span style=&#39;font-size:9.5pt;font-family:Consolas;
  color:blue&#39;&gt;Button, Checkbox, Color Picker, Combo Box, Drop Down, &lt;span
  class=SpellE&gt;Flyout&lt;/span&gt; Anchor, Label, Menu, Menu Section, MRU Split
  Button, Spinner, Split Button, Text Box, and Toggle Button&lt;/span&gt;. Each of
  these controls has to tie with command. This command can be execute at client
  side or server side&lt;/p&gt;
  &lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr style=&#39;mso-yfti-irow:9&#39;&gt;
  &lt;td width=218 valign=top style=&#39;width:108.9pt;border:solid windowtext 1.0pt;
  border-top:none;mso-border-top-alt:solid windowtext .5pt;mso-border-alt:solid windowtext .5pt;
  padding:0in 5.4pt 0in 5.4pt&#39;&gt;
  &lt;p class=MsoNormal style=&#39;margin-bottom:0in;margin-bottom:.0001pt;line-height:
  normal&#39;&gt;&lt;span class=SpellE&gt;ContextualTabs&lt;/span&gt;&lt;/p&gt;
  &lt;/td&gt;
  &lt;td width=740 valign=top style=&#39;width:369.9pt;border-top:none;border-left:
  none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
  mso-border-top-alt:solid windowtext .5pt;mso-border-left-alt:solid windowtext .5pt;
  mso-border-alt:solid windowtext .5pt;padding:0in 5.4pt 0in 5.4pt&#39;&gt;
  &lt;p class=MsoNormal style=&#39;margin-bottom:0in;margin-bottom:.0001pt;line-height:
  normal;mso-layout-grid-align:none;text-autospace:none&#39;&gt;This holds one or more
  tabs and defines the context for holding tabs. Its ID is “&lt;span
  style=&#39;font-size:9.5pt;font-family:Consolas;color:blue&#39;&gt;Ribbon.&lt;span
  class=SpellE&gt;ContextualTabs&lt;/span&gt;”.&lt;/span&gt;We can add custom Contextual Tabs
  and for that we need to configured Location attribute and allowable value is,
  “&lt;span style=&#39;font-size:9.5pt;font-family:Consolas;color:blue&#39;&gt;Ribbon.&lt;span
  class=SpellE&gt;ContextualTabs&lt;/span&gt;._children&lt;/span&gt;”. We can customize the
  OOB contextual tabs also for an instance if you want to add new tab into
  List’s Contextual tab then location attribute would be “&lt;span
  style=&#39;font-size:9.5pt;font-family:Consolas;color:blue&#39;&gt;Ribbon.&lt;span
  class=SpellE&gt;ListContextualGroup&lt;/span&gt;._children&lt;/span&gt;”.&lt;i
  style=&#39;mso-bidi-font-style:normal&#39;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/i&gt;&lt;/p&gt;
  &lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr style=&#39;mso-yfti-irow:10&#39;&gt;
  &lt;td width=218 valign=top style=&#39;width:108.9pt;border:solid windowtext 1.0pt;
  border-top:none;mso-border-top-alt:solid windowtext .5pt;mso-border-alt:solid windowtext .5pt;
  padding:0in 5.4pt 0in 5.4pt&#39;&gt;
  &lt;p class=MsoNormal style=&#39;margin-bottom:0in;margin-bottom:.0001pt;line-height:
  normal&#39;&gt;Ribbon Templates&lt;/p&gt;
  &lt;/td&gt;
  &lt;td width=740 valign=top style=&#39;width:369.9pt;border-top:none;border-left:
  none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
  mso-border-top-alt:solid windowtext .5pt;mso-border-left-alt:solid windowtext .5pt;
  mso-border-alt:solid windowtext .5pt;padding:0in 5.4pt 0in 5.4pt&#39;&gt;
  &lt;p class=MsoNormal style=&#39;margin-bottom:0in;margin-bottom:.0001pt;line-height:
  normal;mso-layout-grid-align:none;text-autospace:none&#39;&gt;It is a collection of
  all group templates. Its ID is “&lt;span class=SpellE&gt;&lt;span style=&#39;font-size:
  9.5pt;font-family:Consolas;color:blue&#39;&gt;Ribbon.Templates&lt;/span&gt;&lt;/span&gt;”. We
  can add custom group template, to do so, the acceptable value for location
  attribute is “&lt;span class=SpellE&gt;&lt;span style=&#39;font-size:9.5pt;font-family:
  Consolas;color:blue&#39;&gt;Ribbon.Templates._children&lt;/span&gt;&lt;/span&gt;”. &lt;span
  style=&#39;font-size:9.5pt;font-family:Consolas;color:blue&#39;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
  &lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr style=&#39;mso-yfti-irow:11&#39;&gt;
  &lt;td width=218 valign=top style=&#39;width:108.9pt;border:solid windowtext 1.0pt;
  border-top:none;mso-border-top-alt:solid windowtext .5pt;mso-border-alt:solid windowtext .5pt;
  padding:0in 5.4pt 0in 5.4pt&#39;&gt;
  &lt;p class=MsoNormal style=&#39;margin-bottom:0in;margin-bottom:.0001pt;line-height:
  normal&#39;&gt;&lt;span class=SpellE&gt;GroupTemplate&lt;/span&gt;&lt;/p&gt;
  &lt;/td&gt;
  &lt;td width=740 valign=top style=&#39;width:369.9pt;border-top:none;border-left:
  none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
  mso-border-top-alt:solid windowtext .5pt;mso-border-left-alt:solid windowtext .5pt;
  mso-border-alt:solid windowtext .5pt;padding:0in 5.4pt 0in 5.4pt&#39;&gt;
  &lt;p class=MsoNormal style=&#39;margin-bottom:0in;margin-bottom:.0001pt;line-height:
  normal&#39;&gt;Every group from tab requires a template, this template helps ribbon
  to control the size of controls and scale them at rendering time.&lt;/p&gt;
  &lt;p class=MsoNormal style=&#39;margin-bottom:0in;margin-bottom:.0001pt;line-height:
  normal&#39;&gt;&lt;span class=SpellE&gt;GroupTemplate&lt;/span&gt; has following child elements:&lt;/p&gt;
  &lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr style=&#39;mso-yfti-irow:12&#39;&gt;
  &lt;td width=218 valign=top style=&#39;width:108.9pt;border:solid windowtext 1.0pt;
  border-top:none;mso-border-top-alt:solid windowtext .5pt;mso-border-alt:solid windowtext .5pt;
  padding:0in 5.4pt 0in 5.4pt&#39;&gt;
  &lt;p class=MsoNormal style=&#39;margin-bottom:0in;margin-bottom:.0001pt;line-height:
  normal&#39;&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/p&gt;
  &lt;/td&gt;
  &lt;td width=740 valign=top style=&#39;width:369.9pt;border-top:none;border-left:
  none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
  mso-border-top-alt:solid windowtext .5pt;mso-border-left-alt:solid windowtext .5pt;
  mso-border-alt:solid windowtext .5pt;padding:0in 5.4pt 0in 5.4pt&#39;&gt;
  &lt;p class=MsoNormal style=&#39;margin-bottom:0in;margin-bottom:.0001pt;line-height:
  normal&#39;&gt;&lt;b style=&#39;mso-bidi-font-weight:normal&#39;&gt;Layout&lt;/b&gt;: Element has &lt;span
  class=SpellE&gt;LayoutTitle&lt;/span&gt; attribute which is used to mention Size
  attribute of &lt;span class=SpellE&gt;MaxSize&lt;/span&gt; and Scale element. [they are
  the child elements of Scaling Element and scaling element is a child element
  of a tab]&lt;/p&gt;
  &lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr style=&#39;mso-yfti-irow:13&#39;&gt;
  &lt;td width=218 valign=top style=&#39;width:108.9pt;border:solid windowtext 1.0pt;
  border-top:none;mso-border-top-alt:solid windowtext .5pt;mso-border-alt:solid windowtext .5pt;
  padding:0in 5.4pt 0in 5.4pt&#39;&gt;
  &lt;p class=MsoNormal style=&#39;margin-bottom:0in;margin-bottom:.0001pt;line-height:
  normal&#39;&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/p&gt;
  &lt;/td&gt;
  &lt;td width=740 valign=top style=&#39;width:369.9pt;border-top:none;border-left:
  none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
  mso-border-top-alt:solid windowtext .5pt;mso-border-left-alt:solid windowtext .5pt;
  mso-border-alt:solid windowtext .5pt;padding:0in 5.4pt 0in 5.4pt&#39;&gt;
  &lt;p class=MsoNormal style=&#39;margin-bottom:0in;margin-bottom:.0001pt;line-height:
  normal&#39;&gt;&lt;b style=&#39;mso-bidi-font-weight:normal&#39;&gt;Section&lt;/b&gt;: Element has two
  child elements Alignment &amp;amp; Type. Alignment defines the position of
  control and Type decides how many rows this section will contain.&lt;/p&gt;
  &lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr style=&#39;mso-yfti-irow:14;mso-yfti-lastrow:yes&#39;&gt;
  &lt;td width=218 valign=top style=&#39;width:108.9pt;border:solid windowtext 1.0pt;
  border-top:none;mso-border-top-alt:solid windowtext .5pt;mso-border-alt:solid windowtext .5pt;
  padding:0in 5.4pt 0in 5.4pt&#39;&gt;
  &lt;p class=MsoNormal style=&#39;margin-bottom:0in;margin-bottom:.0001pt;line-height:
  normal&#39;&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/p&gt;
  &lt;/td&gt;
  &lt;td width=740 valign=top style=&#39;width:369.9pt;border-top:none;border-left:
  none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
  mso-border-top-alt:solid windowtext .5pt;mso-border-left-alt:solid windowtext .5pt;
  mso-border-alt:solid windowtext .5pt;padding:0in 5.4pt 0in 5.4pt&#39;&gt;
  &lt;p class=MsoNormal style=&#39;margin-bottom:0in;margin-bottom:.0001pt;line-height:
  normal&#39;&gt;&lt;b style=&#39;mso-bidi-font-weight:normal&#39;&gt;Row&lt;/b&gt;: Element has three
  child elements &lt;span class=SpellE&gt;ControlRef&lt;/span&gt;, &lt;span class=SpellE&gt;OverflowArea&lt;/span&gt;
  and Strip. &lt;/p&gt;
  &lt;p class=MsoListParagraphCxSpFirst style=&#39;margin-bottom:0in;margin-bottom:
  .0001pt;mso-add-space:auto;text-indent:-.25in;line-height:normal;mso-list:
  l3 level1 lfo9&#39;&gt;&lt;![if !supportLists]&gt;&lt;span style=&#39;font-family:Symbol;
  mso-fareast-font-family:Symbol;mso-bidi-font-family:Symbol&#39;&gt;&lt;span
  style=&#39;mso-list:Ignore&#39;&gt;·&lt;span style=&#39;font:7.0pt &quot;Times New Roman&quot;&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
  &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;![endif]&gt;&lt;span class=SpellE&gt;ControlRef&lt;/span&gt; &amp;amp; &lt;span
  class=SpellE&gt;OverflowArea&lt;/span&gt; Elements has two attributes, &lt;/p&gt;
  &lt;p class=MsoListParagraphCxSpMiddle style=&#39;margin-top:0in;margin-right:0in;
  margin-bottom:0in;margin-left:1.0in;margin-bottom:.0001pt;mso-add-space:auto;
  text-indent:-.25in;line-height:normal;mso-list:l3 level2 lfo9&#39;&gt;&lt;![if !supportLists]&gt;&lt;span
  style=&#39;font-family:&quot;Courier New&quot;;mso-fareast-font-family:&quot;Courier New&quot;&#39;&gt;&lt;span
  style=&#39;mso-list:Ignore&#39;&gt;o&lt;span style=&#39;font:7.0pt &quot;Times New Roman&quot;&#39;&gt;&amp;nbsp;&amp;nbsp;
  &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;![endif]&gt;&lt;span class=SpellE&gt;DisplayMode&lt;/span&gt; which
  controls display of controls. Acceptable values are Small, Medium, Large and
  Text.&lt;/p&gt;
  &lt;p class=MsoListParagraphCxSpMiddle style=&#39;margin-top:0in;margin-right:0in;
  margin-bottom:0in;margin-left:1.0in;margin-bottom:.0001pt;mso-add-space:auto;
  text-indent:-.25in;line-height:normal;mso-list:l3 level2 lfo9&#39;&gt;&lt;![if !supportLists]&gt;&lt;span
  style=&#39;font-family:&quot;Courier New&quot;;mso-fareast-font-family:&quot;Courier New&quot;&#39;&gt;&lt;span
  style=&#39;mso-list:Ignore&#39;&gt;o&lt;span style=&#39;font:7.0pt &quot;Times New Roman&quot;&#39;&gt;&amp;nbsp;&amp;nbsp;
  &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;![endif]&gt;&lt;span class=SpellE&gt;TemplateAlias&lt;/span&gt; its
  values is used to mention &lt;span class=SpellE&gt;TemplateAlias&lt;/span&gt; of control.&lt;/p&gt;
  &lt;p class=MsoListParagraphCxSpLast style=&#39;margin-bottom:0in;margin-bottom:
  .0001pt;mso-add-space:auto;text-indent:-.25in;line-height:normal;mso-list:
  l3 level1 lfo9&#39;&gt;&lt;![if !supportLists]&gt;&lt;span style=&#39;font-family:Symbol;
  mso-fareast-font-family:Symbol;mso-bidi-font-family:Symbol&#39;&gt;&lt;span
  style=&#39;mso-list:Ignore&#39;&gt;·&lt;span style=&#39;font:7.0pt &quot;Times New Roman&quot;&#39;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
  &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;![endif]&gt;Strip: Element contains collection &lt;span
  class=SpellE&gt;ControlRef&lt;/span&gt; elements and they gets displayed as a strip on
  ribbon.&lt;/p&gt;
  &lt;/td&gt;
 &lt;/tr&gt;
&lt;/table&gt;
&lt;/br&gt;
&lt;b&gt;Custom Tab declaration XML,&lt;/b&gt;&lt;/br&gt;
&lt;script type=&quot;syntaxhighlighter&quot; class=&quot;brush: xml&quot;&gt;&lt;![CDATA[
&lt;Elements xmlns=&quot;http://schemas.microsoft.com/sharepoint/&quot;&gt;
  &lt;CustomAction
    Id=&quot;MeVsMyself&quot;
    Location=&quot;CommandUI.Ribbon.NewForm&quot;
    RegistrationId=&quot;100&quot; RegistrationType=&quot;List&quot; &gt;
    &lt;CommandUIExtension&gt;
      &lt;CommandUIDefinitions&gt;
        &lt;CommandUIDefinition
          Location=&quot;Ribbon.Tabs._children&quot; &gt;
          &lt;Tab Id=&quot;MeVsMyself.MyTab&quot;
               Title=&quot;MeVsMyself&quot; Description=&quot;MeVsMyself Menu&quot;
               Sequence=&quot;1005&quot; &gt;
            &lt;Scaling Id=&quot;MeVsMyself.Tab.Scaling&quot;&gt;
              &lt;MaxSize  Id=&quot;MeVsMyself.MyTab.Scaling.NewGroup.MaxSize&quot;
                        GroupId=&quot;MeVsMyself.MyTab.MyGroup&quot;
                        Size=&quot;MeVsMySelfLarge&quot;
                        Sequence=&quot;2&quot;/&gt;
              &lt;Scale    Id=&quot;MeVsMyself.MyTab.Scaling.NewGroup.Large&quot;
                        GroupId=&quot;MeVsMyself.MyTab.MyGroup&quot;
                        Size=&quot;MeVsMySelfLarge&quot; Sequence=&quot;3&quot;/&gt;
            &lt;/Scaling&gt;
            &lt;Groups Id=&quot;MeVsMyself.MyTab.Groups&quot;&gt;
              &lt;Group Id=&quot;MeVsMyself.MyTab.MyGroup&quot;
                     Sequence=&quot;2&quot;
                     Description=&quot;&quot;
                     Title=&quot;My Group&quot;
                     Template=&quot;MeVsMyself.MyTab.MyTemplate&quot;&gt;
                &lt;Controls Id=&quot;MeVsMyself.MyTab.MyGroup.Controls&quot; &gt;
                  &lt;Button
                    Id=&quot;MeVsMyself.MyTab.MyGroup.HelloWorld&quot;
                    Command=&quot;MeVsMyself.MyTab.MyGroup.HelloWorld&quot;
                    Sequence=&quot;3&quot;
                    Image32by32=&quot;/_layouts/$Resources:core,
                                Language;/images/ps32x32.png?vk=4514&quot;
                    Image32by32Top=&quot;-32&quot; Image32by32Left=&quot;-64&quot;
                    LabelText=&quot;Hello World&quot;
                    TemplateAlias=&quot;RowI&quot; ToolTipTitle=&quot;Hello World&quot;
                    ToolTipDescription=&quot;Hello World&quot;/&gt;
                &lt;/Controls&gt;
              &lt;/Group&gt;
            &lt;/Groups&gt;
          &lt;/Tab&gt;
        &lt;/CommandUIDefinition&gt;
        &lt;CommandUIDefinition Location=&quot;Ribbon.Templates._children&quot; &gt;
          &lt;GroupTemplate Id=&quot;MeVsMyself.MyTab.MyTemplate&quot;&gt;
            &lt;Layout Title=&quot;MeVsMySelfLarge&quot;
                      LayoutTitle=&quot;MeVsMySelfLarge&quot;&gt;
              &lt;Section Alignment =&quot;Top&quot; Type=&quot;OneRow&quot;&gt;
                &lt;Row&gt;
                  &lt;ControlRef DisplayMode =&quot;Large&quot; TemplateAlias=&quot;RowI&quot;/&gt;
                &lt;/Row&gt;
              &lt;/Section&gt;
            &lt;/Layout&gt;
          &lt;/GroupTemplate&gt;
        &lt;/CommandUIDefinition&gt;
      &lt;/CommandUIDefinitions&gt;
      &lt;CommandUIHandlers&gt;
        &lt;CommandUIHandler
          Command=&quot;MeVsMyself.MyTab.MyGroup.HelloWorld&quot;
          CommandAction=&quot;javascript:alert(&#39;Hello World&#39;);&quot; /&gt;
      &lt;/CommandUIHandlers&gt;
    &lt;/CommandUIExtension&gt;
  &lt;/CustomAction&gt;
&lt;/Elements&gt;

]]&gt;&lt;/script&gt;

&lt;/br&gt;

&lt;div&gt;
&lt;b&gt;Sample Tab on New Form,&lt;/b&gt;&lt;/br&gt;
&lt;img border=&quot;0&quot; height=&quot;235&quot; width=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiNoNd3So4vsxn0dh8PM19F30-Gp4iWJHN003TnC7vbaiTkgzhvylJ3jXsxuNXFeCjCf-yM7Snk-wefdtDghlAEj1l0FTV_EtVN8yX_0WKm03hrg-z_aiLPqt6QwjaVjBQuuuHNgyqKiGBC/s320/PartI.jpg&quot; /&gt;
&lt;/div&gt;
&lt;/br&gt;


&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;/div&gt;
&lt;/div&gt;

&lt;div&gt;

&lt;a href=&quot;http://sites.google.com/site/makarandsharepoint/mak/PartI.zip&quot;&gt;&lt;strong&gt;Download: Source Code&lt;/strong&gt;&lt;/a&gt;
&lt;br /&gt;
&lt;strong&gt;Further Articles:&lt;/strong&gt; &lt;br /&gt;
I am going to explore more with ribbon and going to post all my findings with source code. So keep a track of below articles.&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://makarandrkulkarni.blogspot.com/2010/01/architecture-of-sharepoint-2010-ribbon.html&quot;&gt;SharePoint 2010 Ribbon Customization Part I: Architecture of Ribbon&lt;/a&gt;&lt;br /&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://makarandrkulkarni.blogspot.com/2010/01/sharepoint-2010-ribbon-customization.html&quot;&gt;SharePoint 2010 Ribbon Customization Part II: How to Add/Remove/Replace Tab Controls&lt;/a&gt;&lt;br /&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://makarandrkulkarni.blogspot.com/2010/01/sharepoint-2010-ribbon-customization_09.html&quot;&gt;SharePoint 2010 Ribbon Customization Part III: How to create Tab at various Locations?&lt;/a&gt;&lt;br /&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://makarandrkulkarni.blogspot.com/2010/01/new-one.html&quot;&gt;SharePoint 2010 Ribbon Customization Part IV: How to add PostBack commands to ribbon?&lt;/a&gt;&lt;br /&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://makarandrkulkarni.blogspot.com/2010/01/sharepoint-2010-ribbon-customization_5976.html&quot;&gt;SharePoint 2010 Ribbon Customization Part V: How to dynamically populate ribbon controls?&lt;/a&gt;&lt;br /&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://makarandrkulkarni.blogspot.com/2010/01/sharepoint-2010-ribbon-customization_23.html&quot;&gt;SharePoint 2010 Ribbon Customization Part VI: How to enable/disable buttons in ribbon conditionally?&lt;/a&gt;&lt;br /&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://makarandrkulkarni.blogspot.com/feeds/6502334938617141647/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://makarandrkulkarni.blogspot.com/2010/01/architecture-of-sharepoint-2010-ribbon.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7021741417853834113/posts/default/6502334938617141647'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7021741417853834113/posts/default/6502334938617141647'/><link rel='alternate' type='text/html' href='http://makarandrkulkarni.blogspot.com/2010/01/architecture-of-sharepoint-2010-ribbon.html' title='SharePoint 2010 Ribbon Customization Part I: Architecture of Ribbon'/><author><name>makarand Kulkarni</name><uri>http://www.blogger.com/profile/00881181707083196500</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiNoNd3So4vsxn0dh8PM19F30-Gp4iWJHN003TnC7vbaiTkgzhvylJ3jXsxuNXFeCjCf-yM7Snk-wefdtDghlAEj1l0FTV_EtVN8yX_0WKm03hrg-z_aiLPqt6QwjaVjBQuuuHNgyqKiGBC/s72-c/PartI.jpg" height="72" width="72"/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7021741417853834113.post-4106048872970880187</id><published>2009-09-05T13:10:00.020+05:30</published><updated>2009-09-05T16:11:34.420+05:30</updated><category scheme="http://www.blogger.com/atom/ns#" term="SharePoint Object Model 2010"/><category scheme="http://www.blogger.com/atom/ns#" term="VS2010"/><title type='text'>SharePoint Client Object Model fails in VS2010</title><content type='html'>&lt;div style=&quot;color: black; font-family: Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;I found one strange behavior with VS2010 and MOSS 2010. When I tried to run Object Model from console application to access MOSS2010 application, I found it failed by raising an exception&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: left;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhLM_XX3awBcFeKFyXCY2y63ugFCfwjzT_kmoZ31tM07oNLzzY5h4klOFxSP1KN6xCgTZHlTB5hCIYAAaw7Drm_JD46gLWxoepXWOoJSfpCUjS_StuaYncA4lSWMZRvZvLmKesGBGNqJgIF/s1600-h/Exception.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhLM_XX3awBcFeKFyXCY2y63ugFCfwjzT_kmoZ31tM07oNLzzY5h4klOFxSP1KN6xCgTZHlTB5hCIYAAaw7Drm_JD46gLWxoepXWOoJSfpCUjS_StuaYncA4lSWMZRvZvLmKesGBGNqJgIF/s320/Exception.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;color: black; font-family: Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;After analysis I found it is a bug in VS2010 Console/Web Template, it fails to run object model with Target Framework 4.0 and Platform target x86/x64. So the solution to this is change Target Framework to 3.5 and Platform Target to “Any CPU” on project properties page.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;color: #e1771e; font-family: Verdana,sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;If anyone still struggles, ref&lt;/span&gt;:&lt;a href=&quot;http://www.kbalertz.com/935751/Error-message-iterate-through-Windows-SharePoint-Services-objects-SharePoint-Server-objects-using-SharePoint-object.aspx&quot;&gt; FileNotFoundException&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://makarandrkulkarni.blogspot.com/feeds/4106048872970880187/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://makarandrkulkarni.blogspot.com/2009/09/sharepoint-client-object-model-fails-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7021741417853834113/posts/default/4106048872970880187'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7021741417853834113/posts/default/4106048872970880187'/><link rel='alternate' type='text/html' href='http://makarandrkulkarni.blogspot.com/2009/09/sharepoint-client-object-model-fails-in.html' title='SharePoint Client Object Model fails in VS2010'/><author><name>makarand Kulkarni</name><uri>http://www.blogger.com/profile/00881181707083196500</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhLM_XX3awBcFeKFyXCY2y63ugFCfwjzT_kmoZ31tM07oNLzzY5h4klOFxSP1KN6xCgTZHlTB5hCIYAAaw7Drm_JD46gLWxoepXWOoJSfpCUjS_StuaYncA4lSWMZRvZvLmKesGBGNqJgIF/s72-c/Exception.jpg" height="72" width="72"/><thr:total>0</thr:total></entry></feed>