05-12-2020 12:45 AM
Hi,
i have written below code in one js file .. to add custom functionality o n my action:
onActionCreatePackage: function dlA__createPackage(record)
{
if (!this.modules.createPackage)
{
this.modules.createPackage = new Alfresco.module.DoclibCreatePackage(this.id + "-createPackage");
}
var zIndex = 0;
if (this.fullscreen !== undefined && ( this.fullscreen.isWindowOnly || Dom.hasClass(this.id, 'alf-fullscreen')))
{
zIndex = 1000;
}
var parentElement = undefined;
if (Dom.hasClass(this.id, 'alf-true-fullscreen'))
{
parentElement = Dom.get(this.id);
}
this.modules.createPackage.setOptions(
{
siteId: this.options.siteId,
containerId: this.options.containerId,
path: this.currentPath,
files: record,
rootNode: this.options.repositoryBrowsing ? this.modules.createPackage.options.rootNode : this.options.rootNode,
repositoryRoot: this.options.repositoryRoot,
parentId: this.getParentNodeRef(record),
zIndex: zIndex,
parentElement : parentElement ? parentElement : undefined,
currNodeRef: record.nodeRef
}).showDialog()//.showDialog(); //setOptions(
}
But how can i access this currNodeRef in my .get.js file.
Thank you!!
05-17-2020 12:30 PM
1) You actually have to make a call to a web script somewhere - in the code sample you provided there is no mention of any call to a *.get.js web script anywhere
2) any event details that you need in your web script you have to pass yourself by providing them in the URL query arguments
3) any access to nodes will require you to lookup nodes based on their node ref or metadata - you don't magically get a node that you can access. In a JS file, this will usually be done vie search.findNode(ref) or search.query(paramObj)
Explore our Alfresco products with the links below. Use labels to filter content by product module.