problem calling path selector in alfresco 5

cancel
Showing results for 
Search instead for 
Did you mean: 
aalvarezfern
Member II

problem calling path selector in alfresco 5

Hello, im migrating a share extension from alfresco 4.1 to alfresco 5.1. Im trying to use  a path selector  in a surf page . I have  a button that triggers the path selector.

Here is the code of the button:

function selectFolder(e){
  var cFolder = new Alfresco.module.DoclibGlobalFolder("doclib-selectFilterPath");

  var allowedViewModes =
     [
         Alfresco.module.DoclibGlobalFolder.VIEW_MODE_REPOSITORY
     ];
 YAHOO.Bubbling.on("folderSelected", function (layer, args)

{
  var obj = args[1];
   if (obj !== null)

      {
        document.getElementById("rutaExtracto").value = obj.selectedFolder.path;
         document.getElementById("rutaExtractoNodeRef").value = obj.selectedFolder.nodeRef;
         document.getElementById("rutaExtracto").style.color = "black";
        document.getElementById("ruta Error").style.display="none";
      }
}, this);
cFolder.setOptions(
  {
    allowedViewModes: allowedViewModes,
    containerId: "doclib-selectFilterPath",
    title: "Seleccione la ruta"
  });
 cFolder.showDialog();
 return false; // el boton no haga nada
}

 in the ftll where the button is placed  i had to insert this includes :

<@markup id="css" >
<#-- CSS Dependencies -->
<@link href="${url.context}/res/modules/documentlibrary/global-folder.css" group="node-header"/>
</@>


<@markup id="js" >
<#-- JS Dependencies -->
<script type="text/javascript" src="${url.context}/res/modules/documentlibrary/global-folder.js" group="node-header"></script>
</@>

When i press the button the   path  selector appears ,but gets stuck while trying to load  the folder tree.In the browser console i find this error:

Uncaught TypeError: Alfresco.CommonComponentStyleFilterChain is not a constructor
at Alfresco.module.DoclibGlobalFolder.DLGF__buildCustomStyleClass [as _buildCustomStyleClass] (global-folder.js:1521)
at Alfresco.module.DoclibGlobalFolder.DLGF_lND_success (global-folder.js:572)
at Object.handleTransactionResponse (yui-common_5518510ec77ced541930f488625ed9c0.js:13891)
at yui-common_5518510ec77ced541930f488625ed9c0.js:13830

Does someone know why this is happening? how could this be solved? 

Thanks in advance

2 Replies
hardik_thakkar
Active Member II

Re: problem calling path selector in alfresco 5

Hi Adrian,

Are you able to find the solution for this one?

Thanks,

Hardik

rbr
Partner

Re: problem calling path selector in alfresco 5

Hi,

you need to add this JS as dependency :

common-component-style-filter-chain.js