Is there some to prevent MouseDown and MouseUp to fire ?


on this WebPage I have a List which is WebContainer with WebContainers embedded into. When the user clicks on one of the embedded WebContainers:

  • MouseDown displays a ProgressWheel
  • MouseUp raises a Defined Event whose code download a PDF file from a database and displays it in a WebHTMLViewer. Then the ProgressWheel is hidden.

The process takes from 2 to 4 seconds, depending on the size of the PDF file. I don’t want the user to be able to click on another WebContainer in the list until the PDF process is finished. In order to block the user from doing another selection, I thought of using an App property that when set to True would prevent the MouseDown and MouseUp from executing by checking the value of the property right at the beginning . . . But that doesn’t work, the second click process is executed and its the second PDF that is displayed.

To me it looks like further clicks are queued and process because being delayed, the flag is never True. Is this the right explanation ? If so, how can I prevent the user from clicking until process has terminated ?


Here is an option:

  • At the first mousedown, set a property at container level (or any other appropriate level, page or even session depending on your app and design), say “NoReenter” to True. Always check if NoReenter is true before processing the remainder of the event. Return true when the property is True.
  • At the end of the mouseup event, set the NoReenter property to False.

That should prevent multiple clicks to be actioned, at least until the first one is finished processing.

The best way to prevent any additional execution would be to display a modal webdialog.

Simply close it when you are ready for the next file.