AnsweredAssumed Answered

Custom client-side JavaScript not called

Question asked by pkanuri on Aug 7, 2016
Latest reply on Aug 8, 2016 by pkanuri
Apologies , code was missing in my original post.


I have been trying , in vain, for 3 days now to call a custom client side jS function from an action.

In my share-config-custom.xml

<config evaluator="string-compare" condition="DocLibActions">
       <action id="document-archive" type="javascript" label="Archive">
            <param name="function">onActionChangeTypo</param>
                <permission allow="true">Write</permission>
            <param name="action">expire-artefact</param>
            <param name="successMessage">Artefact successfully expired</param>
            <param name="failureMessage">Failed to Expire artefact</param>

<!– Document Library Custom Code config section –>
   <config evaluator="string-compare" condition="DocLibCustom" replace="true">
            <!–css src="my-custom-action.css" /–>
            <js src="components/documentlibrary/my-custom-action.js" />

I am able to view the "action" menuitem in the "Document Actions" . But clicking it does NOT call the function in my-custom-action.js that I had placed under ../tomcat/webapps/share/components/documentlibrary/my-custom-action.js (my-custom-action-min.js as well).

Here is the content of my-custom-action.js. It is quite straightforward. Just pop up a dialog (for now)

(function() {"registerAction",
        actionName: "onActionChangeTypo",
        fn: function custom_onActionChangeTypo(file) {
           var displayPromptText = this.msg("Do you want to expire this artefact?", file.displayName);

I am frustrated that my JS function isn't getting called at all. I've tried changing the paths in the dependencies but no luck.

Kindly let me know if I am missing something.

Really appreciate any help.