AnsweredAssumed Answered

Display Custom Property from Object Finder Component

Question asked by mdavid.cu on Oct 27, 2013
Latest reply on Oct 28, 2013 by mitpatoliya
Dear Alfresco Community,

   I´m trying to use the Alfresco Object Finder Component for providing selectable capabilities in a custom property who must contain a NodeRef value. The idea is very similar to the category.ftl control but referencing a custom NodeType. That works fine!. But when the Object Finder displays the node, i always got the UUID property.

My instantiation of the Object Finder is something like this:

  <@renderPickerJS field "picker" />
   picker.setOptions(
   {
      itemType: "tdl:tagContainer",
      multipleSelectMode: ${(field.control.params.multipleSelectMode!true)?string},
      parentNodeRef: "workspace://SpacesStore/be767794-5055-493b-866b-04cb23440c1f", 
      field: "tdl:spanishTagValue",
      maintainAddedRemovedItems: false,
      params: "${field.control.params.params!""}",
      createNewItemUri: "${field.control.params.createNewItemUri!}",
      createNewItemIcon: "${field.control.params.createNewItemIcon!}"
   });


I have been tracing the Repository Web Script responsable for providing the datas to the Object Finder and I found the following issue in the pickerresults.lib.ftl:



"items":
      [
      <#list results as row>
         {
            "type": "${row.item.typeShort}",
            "isContainer": ${row.item.isContainer?string},
            "name": "${row.item.properties.name!""}",
            "title": "${row.item.properties.title!""}",
            "description": "${row.item.properties.description!""}",
            <#if row.item.properties.modified??>"modified": "${xmldate(row.item.properties.modified)}",</#if>
            <#if row.item.properties.modifier??>"modifier": "${row.item.properties.modifier}",</#if>
            <#if row.item.siteShortName??>"site": "${row.item.siteShortName}",</#if>
            "displayPath": "${row.item.displayPath!""}",
            "nodeRef": "${row.item.nodeRef}"<#if row.selectable?exists>,
            "selectable" : ${row.selectable?string}</#if>
         }<#if row_has_next>,</#if>
      </#list>
      ]



As you'll can see, those are the only properties available for the Object Finder Component in the data Web Scripts.

So… How can I display a custom property in the Object Finder ?
There is a way?
Or I need to use always the cm:name property ?

Thanks!!

Outcomes