AnsweredAssumed Answered

Share Action - registerAction

Question asked by mtw999 on May 28, 2014
Latest reply on Jun 2, 2014 by mtw999
Hi,

I'm trying to have this action call another function on success/failure. Below works fine, but second variation does not even seem to get loaded. Only difference is in the success: has callback function

Ho can I determine why this is not working if it does not even seem to be loaded…..?

Loads (can see in Firebug) & executes:
(function() {
    /**
     * Method loads and executes CloseSubmission Module
     */
    YAHOO.Bubbling.fire("registerAction", {
        actionName : "onCloseSubmissionAction",
        fn : function FDA_onCloseSubmissionAction(record, owner) {

         // Get action params
         var params = this.getAction(record, owner).params, displayName = record.displayName;
         var me = this, jsNode = record.jsNode;
         // Prepare genericAction config
         var config = {
            success : {
               event : {
                  name : "metadataRefresh",
                  obj : record
               }
            },
            failure : {
               message : this.msg(params.failureMessage, displayName)
            },
            webscript : {
               method : Alfresco.util.Ajax.POST,
               stem : Alfresco.constants.PROXY_URI + "api/",
               name : "actionQueue"
            },
            config : {
               requestContentType : Alfresco.util.Ajax.JSON,
               dataObj : {
                  actionedUponNode : record.nodeRef,
                  actionDefinitionName : params.action
               }
            }
         };

Does not Loads (cannot see in Firebug):
(function() {
    /**
     * Method loads and executes CloseSubmission Module
     */
    YAHOO.Bubbling.fire("registerAction", {
        actionName : "onCloseSubmissionAction",
        fn : function FDA_onCloseSubmissionAction(record, owner)
       {
         // Get action params
         var params = this.getAction(record, owner).params, displayName = record.displayName;
         var me = this, jsNode = record.jsNode;
         // Prepare genericAction config
         var config = {
                  success:
                  {
                     callback:
                     {
                        fn: function my_success()
                        {
                              Alfresco.util.PopupManager.displayPrompt(
                              {
                                 title: this.msg("my test"),
                                 text: this.msg("message"),
                                 buttons: [
                                 {
                                    text: this.msg("OK"),
                                    handler: function my_success_ok()
                                    {
                                       this.destroy();
                                    },
                                    isDefault: true
                                 },
                                 {
                                    text: this.msg("Cancel"),
                                    handler: function my_success_cancel()
                                    {
                                       this.destroy();
                                    }
                                 }]
                              });
                        },
                        scope: this
                     }
                  },
            failure : {
               message : this.msg(params.failureMessage, displayName)
            },
            webscript : {
               method : Alfresco.util.Ajax.POST,
               stem : Alfresco.constants.PROXY_URI + "api/",
               name : "actionQueue"
            },
            config : {
               requestContentType : Alfresco.util.Ajax.JSON,
               dataObj : {
                  actionedUponNode : record.nodeRef,
                  actionDefinitionName : params.action
               }
            }
         };………


Mike

Outcomes