cancel
Showing results for 
Search instead for 
Did you mean: 

Fire a registered action from a custom html link

mtsiak
Star Contributor
Star Contributor

The idea is to simplify the document's view. One task is to separate the most used actions (our custom and alfresco' s built in actions) with the rest.

One thought is to create a custom panel (Favorite Actions) in the document-details page, above the Document Actions.

How can we add (javascript) actions in this custom panel with all the related functionalities (action type, success messages, javascript event, params.. )

I.e. we could add html links in the ftl, could we relate the javascript action will be fired? (YAHOO.Bubbling.fire("registerAction", ... )  -- when the type of the action is type="javascript")

Thanks in advance.

5 REPLIES 5

sujaypillai
Confirmed Champ
Confirmed Champ

You may check out this tutorial here.

mtsiak
Star Contributor
Star Contributor

Sujay thank you for your reply. We have created a doclib javascript action with success, using the above tutorial.

But these actions can be set visible only in available actionGroups, such as 'document-details'.

The question is how could i set visible this action in our custom panel above the 'Document Actions'. Or what javascript action is actually been fired, so as to hardcode it in our panel's ftl.

I have read that as well and guided me to create the custom panel. Thank you.

But how do I add actions in the acme-sample sub-component? And not in the document-details? Should I extend the DefaultDoclistActionGroupResolver and will work?

mtsiak
Star Contributor
Star Contributor

I hardcoded in the ftl of the custom panel

<div class="my.doclib.action.id" id="myJavascriptFunctionNameThatCallsAWebScript">
  <a title="a title" class="action-link" href="#"
    style="background-image:url(/share/res/components/documentlibrary/actions/document-assign-workflow-16.png)">
    <span>my action</span>

  </a>
</div>

and the action is called as it was in the document actions panel. It is a partial solution as we can not use the evaluators.