AnsweredAssumed Answered

Wait message in Share javascript component object

Question asked by fast3r on Jun 22, 2010
Latest reply on Jun 23, 2010 by fast3r
Hi everybody,
I'm trying to configurate a waiting message in the javascript part of a Webscript. In a few words, when a user changes the selection of a select field, some operations are made in the page DOM and, until they're finished, I want a message to be displayed to the user.

I have an event listener for the select change in the standard Alfresco onReady function:
YAHOO.util.Event.addListener(some_select_field_element, "change", this.applyFilters, this, true);

The applyFilters() function is something like this:


this._setBusy(message);

// do some long operations

this._releaseBusy();

And the  _setBusy() and _releaseBusy() are:


      _releaseBusy: function Schedule_releaseBusy()
      {
         if (this.busy)
         {
            this.widgets.busyMessage.destroy();
            this.busy = false;
            return true;
         }
         else
         {
            return false;
         }
      },

      _setBusy: function Schedule_setBusy(message)
      {
         if (this.busy)
         {
            return false;
         }
         this.busy = true;
         this.widgets.busyMessage = Alfresco.util.PopupManager.displayMessage(
         {
            text: message,
            spanClass: "wait",
            displayTime: 0,
         });
         return true;
      },

The question is that the message is showed only AFTER the "long operations" have been made, just a few time before the _releaseBusy() function call. Why??! Am I missing something?
I have seen this pattern in a few components in Share, for example when deleting a Site, and it works correctly!

Thank you for any help…

Outcomes