cancel
Showing results for 
Search instead for 
Did you mean: 

Which document a custom action+dialog was started on?

nicolasraoul
Star Contributor
Star Contributor
Hello all,

Here is my scenario:
1) In the Alfresco Web Client, the user clicks on the "More actions" arrow of a document.
2) This "More actions" menu contains a "Process this document" item.
3) Clicking on this item calls the "MyCustomDialog" dialog.
4) This dialog's "init" method is called just after the click, right before showing the dialog (I checked with Eclipse debug).
5) In this "init" method, I do various things based on the document's name.

No problem with steps 1 to 4, I did everything as described on the Wiki.
But in step 5, I have no idea which document the user started the action on. 😞
- The "parameters" variable passed by the "init" method of the custom dialog is null.
- browseBean.getDocument() returns null too.

How can I know what document the action was started on?

Thanks a lot! 🙂
Nicolas
1 REPLY 1

nicolasraoul
Star Contributor
Star Contributor
I have found!

this.browseBean.getActionSpace().getNodeRef()

This code in the "init" method gives a NodeRef to the document the custom action was started on.
Despite having "Space" in its name, it is not the space that is returned, but really the document itself… I am not sure what is the meaning of "Space" here, anyone knows?

Thanks!