Home

Calling Alfresco.util.PopupManager.displayMessage in action

You are here

3 posts / 0 new
Last post
Calling Alfresco.util.PopupManager.displayMessage in action

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

Re: Calling Alfresco.util.PopupManager.displayMessage in act

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.

Arnold Schrijver
IT Architect at Adnovate

Re: Calling Alfresco.util.PopupManager.displayMessage in act

Thanks Arnold, I've kept the first solution and now it works!