2

I have added a custom column(schemaName) in Tridion ListView to display additional information for each content Item.
Everything looks great and the column displays the required information until a content item is opened, going back to the tree view after opening (or closing subsequently) a content item, the respective data for that content item is no longer displayed in the custom column.

The issue:

After closing opened item However, on refreshing the list the data is displayed correctly: enter image description here Below are the steps that I have followed to add the new column:

  1. Created a .NET class by extending the DataExtender class and implementing ProcessRequest method
  2. Added the Data Extender to the configuration file in the custom editor
  3. Updated the System.config file to add the extra column in Content Manager Explorer. 

To resolve the above issue, I tried adding a Javascript class to handle list refreshing (as explained in the below URLs) but the issue is still not resolved:
-Data Extender and Custom Listdefinitions: Disappearing data
-http://jaimesantosalcon.blogspot.in/2012/04/sdl-tridion-2011-data-extenders-real.html

Please let me know what else should be done to resolve the issue?

UPDATED:
Config file:

 <?xml version="1.0"?>
<Configuration xmlns="http://www.sdltridion.com/2009/GUI/Configuration/Merge"
               xmlns:cfg="http://www.sdltridion.com/2009/GUI/Configuration"
                             xmlns:ext="http://www.sdltridion.com/2009/GUI/extensions"
               xmlns:cmenu="http://www.sdltridion.com/2009/GUI/extensions/ContextMenu">

  <resources cache="true">
    <cfg:filters />
    <cfg:groups>
      <cfg:group name="GUIExtension.UI.Model" merger="Tridion.Web.UI.Core.Configuration.Resources.DomainModelProcessor" merge="always">
        <cfg:domainmodel name="GUIExtension.UI.Model">
          <cfg:fileset>
            <cfg:file type="script">ExtendedComponent.js</cfg:file>
          </cfg:fileset>
          <cfg:services />
        </cfg:domainmodel>
      </cfg:group>
    </cfg:groups>
  </resources>
  <definitionfiles />
  <extensions>
    <ext:dataextenders>
      <ext:dataextender type="GUIExtension.GUIDataExtender, GUIDataExtender" name="SchemaNamExtender">
        <ext:description>Schema Name Extender</ext:description>
      </ext:dataextender>
    </ext:dataextenders>
    <ext:modelextensions>
      <cfg:itemtypes>
        <cfg:itemtype id="tcm:16" implementation="GUIExtension.UI.ExtendedComponent" />
      </cfg:itemtypes>
    </ext:modelextensions>
    <ext:editorextensions>
      <ext:editorextension target="CME">
        <ext:editurls/>
        <ext:listdefinitions/>
        <ext:taskbars/>
        <ext:commands/>
        <ext:commandextensions/>        
        <ext:contextmenus/>
        <ext:lists>
          <ext:add>
            <ext:extension name="SchemaNameExtender" assignid="SchemaNameExtender" insertbefore="NamedType">
              <ext:listDefinition>
                <ext:selectornamespaces/>
                <ext:columns>
                 <column xmlns="http://www.sdltridion.com/2009/GUI/extensions/List"
                             id="Schema Name" type="data" title="Schema Name"
                             selector="@ExtendedInfo" translate="String" />
                </ext:columns>
              </ext:listDefinition>
              <ext:apply>
                <ext:view name="DashboardView" />
              </ext:apply>
            </ext:extension>  
          </ext:add>
        </ext:lists>
        <ext:tabpages/>
        <ext:toolbars/>
        <ext:ribbontoolbars/>
      </ext:editorextension>
    </ext:editorextensions>
  </extensions>
  <commands/>
  <contextmenus />
  <localization />
  <settings>
    <defaultpage/><!-- /Views/Default.aspx</defaultpage> -->
    <navigatorurl/><!-- /Views/Default.aspx</navigatorurl> -->
    <editurls/>
    <listdefinitions />
    <itemicons/>
    <theme>
      <path>theme/</path>
    </theme>
    <customconfiguration />
  </settings>
</Configuration>

JS File:

   Type.registerNamespace("GUIExtension.UI");
GUIExtension.UI.ExtendedComponent = function ExtendedComponent(id) {

   Tridion.OO.enableInterface(this, "GUIExtension.UI.ExtendedComponent");
    this.addInterface("Tridion.ContentManager.Component", [id]);

    var p = this.properties;
    p.versionNumberString = undefined;
    p.modifiedBy = undefined;
    p.lockedBy = undefined;
    p.approvalStatus = undefined;
    p.publishDate = undefined;
    p.previousVersion = undefined;
    p.previousApprovalStatus = undefined;
    p.customModifiedDate = undefined;
    p.initialModifierUserName = undefined;
};


GUIExtension.UI.ExtendedComponent.prototype.setDataFromList = function ExtendedComponent$setDataFromList(node, parentId, timeStamp) {

    var p = this.properties;

    if (!timeStamp || timeStamp > this.getTimeStamp()) {
        var tmp;

        if (tmp = $xml.getInnerText(node, "@ExtendedInfo")) {
            p.extendedInfo = tmp;
        }
    }
    this.callBase("Tridion.ContentManager.Component", "setDataFromList", [node, parentId, timeStamp]);
};
GUIExtension.UI.ExtendedComponent.prototype.getListItemXmlAttributes = function ExtendedComponent$getListItemXmlAttributes(customAttributes) {

    var attribs = {};
    var p = this.properties;

    if (customAttributes) {
        for (var attr in customAttributes) {
            attribs[attr] = customAttributes[attr];
        }
    }
    //This adds my custom column back when the item is updated
    attribs["ExtendedInfo"] = p.extendedInfo;
    return this.callBase("Tridion.ContentManager.Component", "getListItemXmlAttributes", [attribs])
};
5
  • can you edit your question and make the issue a bit more clear? you mention the column data is disappearing on opening a content item, do you mean when you go back to the tree view after opening a new window (for the item), that the added column is empty or completely gone? Adding a screenshot of what you talk about might also be useful for us to understand what you mean. Feb 17, 2016 at 13:14
  • please edit the question next time (see how I did it, and feel free to adjust yourself) and update its information, that is way more readable for everybody than just answering me in the comments. Keep in mind the entire community on this site is there to help you, you want to inform them, not just me ;o). Feb 17, 2016 at 13:53
  • Abhishek, can you verify if you are actually referring your JS file in the GUI Extension configuration? If there's a missing reference, the JS file will never be loaded. Can you post the complete configuration of the GUI Extension?
    – Kunal
    Feb 21, 2016 at 9:48
  • I verified and i think i am not missing any reference. I also updated full config file in question. Feb 22, 2016 at 5:48
  • Can any one help me on that still i m not getting what i am missing.... Feb 24, 2016 at 13:52

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.