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
Hi Adrian,
Are you able to find the solution for this one?
Thanks,
Hardik
Hi,
you need to add this JS as dependency :
common-component-style-filter-chain.js
Ask for and offer help to other Alfresco Content Services Users and members of the Alfresco team.
Related links:
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.