No able to access variable of YUI events

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

No able to access variable of YUI events

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!!

 

1 Reply
afaust
Master

Re: No able to access variable of YUI events

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)