cancel
Showing results for 
Search instead for 
Did you mean: 

Calling Alfresco.util.PopupManager.displayMessage in action

remigiodm
Champ in-the-making
Champ in-the-making
I need to call the Alfresco.util.PopupManager.displayMessage function before starting a long running Share document library custom action.
I've tried to pass the wait parameter to the generic action as follows:


   Alfresco.DocumentList.prototype.onActionStartWorkflows = function DL_onActionStartWorkflows(file)   {
       this.modules.actions.genericAction(
      {
         success:
         {
            message: this.msg("message.start-workflows.success", file.displayName)
         },
         failure:
         {
            message: this.msg("message.start-workflows.failure", file.displayName)
         },
         webscript:
         {
            name: "start-workflows/site/{site}/{container}",
            method: Alfresco.util.Ajax.POST
         },
    wait:
    {
       message: this.msg("message.start-workflows.please-wait")
    },
         params:
         {
            site: this.options.siteId,
            container: this.options.containerId
         },
         config:
         {
            requestContentType: Alfresco.util.Ajax.JSON,
            dataObj:
            {
               nodeRefs: [file.nodeRef]
            }
         }
      });
   };

the action is correctly executed but no message is shown.
If I try to call the Alfresco.util.PopupManager.displayMessage in the action script:

Alfresco.util.PopupManager.displayMessage(
{
    text: "Starting workflow, please wait"
});

the script fails to execute with no log messages so I can't figure the reason.
Can anyone help me?
Thanks in advance.

Remigio
3 REPLIES 3

arnoldschrijve1
Champ on-the-rise
Champ on-the-rise
Looking at the definition of genericAction in modules/documentlibrary/doclib-actions.js on line 227 (CE 4.0.b) it only supports specifying a message as in your first sample. Should be easy to debug here (using Firebug or some other app) and see why it is not picking up your message.

remigiodm
Champ in-the-making
Champ in-the-making
Thanks Arnold, I've kept the first solution and now it works!

Hi can you please guide me how are able to do this and what steps you took?

Raghav Bhardwaj