Alpha Video Training
Results 1 to 6 of 6

Thread: hideWaitMessage firing too soon

  1. #1
    "Certified" Alphaholic
    Real Name
    Chris Tappan
    Join Date
    Jun 2009
    Location
    Marietta, GA
    Posts
    1,297

    Default hideWaitMessage firing too soon

    I have a list in a UX that persists data, and I have Javascript that refreshes the list data when the UX is opened. The list has lots of data so it can take a several seconds to refresh.

    Per the javascript, the showWaitMessage fires before the refreshListData, and then a hideWaitMessage is used the onListReady event of the list.

    The hideWaitMessage consistently disappears before the list is totally rendered or refreshed (or something). Users will see the message disappear, click on a record and start interacting with it, and then the list actually finishes refreshing and changes what they've worked on or execute show/hide or enable/disable Javascript that's confusing.

    I've tried putting the hideWaitMessage in several of the list events and haven't had any better success. Is there a better way to tell that the UX and list data are truly finished loading so I can keep the wait message up until it's safe to start working?

  2. #2
    "Certified" Alphaholic
    Real Name
    David Kates
    Join Date
    Apr 2008
    Location
    Unionville, ON
    Posts
    7,759

    Default Re: hideWaitMessage firing too soon

    This is another example of how bad, and wrong, the Alpha documentation is.

    A good tip that works for some methods, and does work for showWaitMessage, is to create Action Javascript... and then turn that action into code. The action has a property for "Auto close after how many milliseconds". Fill that in and when you turn the action into code you'll see how it's used...

    Code:
    {dialog.object}.showWaitMessage('container:CONTAINER_1',{useCSSAnimation: false,message: 'Wait...',icon: 'css/A5System/Images/wait.gif',waitMessageAutoCloseDelay: 10000});
    In the in-line help for this action, in the milliseconds property, you'll see a reference to {dialog.Object}.waitMessageAutoCloseDelay. This is a dialog property you can set in your Javascript code.

    Set a long wait message time and then your hideWaitMessage() will close the message when you run it.

    Code:
    {dialog.Object}.waitMessageAutoCloseDelay = 65000;
    {dialog.object}.showWaitMessage('container:CONTAINER_1',{useCSSAnimation: false,message: 'Wait...',icon: 'css/A5System/Images/wait.gif'});

  3. #3
    Member
    Real Name
    Sean OKelly
    Join Date
    Sep 2015
    Location
    Charleston, WV
    Posts
    242

    Default Re: hideWaitMessage firing too soon

    Try following the action javascript we have in the image below. It works well for several applications. In this case, we are requesting the user click a button to refesh, but you don't have to do that. Use any event you want to trigger it.sync_process.png

    Make sure to check the box "run actions synchronously" at the bottom.

  4. #4
    "Certified" Alphaholic
    Real Name
    Gregg Schmidt
    Join Date
    Mar 2001
    Location
    Milwaukee
    Posts
    1,393

    Default Re: hideWaitMessage firing too soon

    It's been a long night, so I'm not going to try the correct terminology.
    JavaScript by default does not wait for one command to finish before executing the next command.
    I believe the solution is to wrap the code to refreshListData in a function.
    This link explains it much better than I do https://www.freecodecamp.org/news/ja...-1cc090ddad99/.

  5. #5
    "Certified" Alphaholic
    Real Name
    David Kates
    Join Date
    Apr 2008
    Location
    Unionville, ON
    Posts
    7,759

    Default Re: hideWaitMessage firing too soon

    Which List events have you tried? In my UX, refreshing a 35,000 row list take approx. 12-15 seconds. Using onListDraw seems to work well - I put the .hideWaitMessage() in there.

  6. #6
    Member
    Real Name
    Sean OKelly
    Join Date
    Sep 2015
    Location
    Charleston, WV
    Posts
    242

    Default Re: hideWaitMessage firing too soon

    Your issue is common and that is why Alpha has an action that fires once the sync is complete. You can use that along with what I mentioned. What we have instituted works really well, but it does add a layer of control on top which prevents the user from clicking on the list until it's been refreshed. You could use the server side "after sync" event as well as the "after save confirmation". Both are in the list detail properties. I think there are a lot of built in options it just depends on your specific use case and requirements.

    You could also take full control of the sync process if you want...and handle it all programmatically and remove most of the javascirpt calls. We did that on one project and it was a pain - but it did work. We had to do that for a different reason though.

    Good luck.

Similar Threads

  1. logintest not firing?
    By StephenP in forum Web Application Server v7
    Replies: 6
    Last Post: 07-21-2006, 10:41 AM
  2. autoexec not firing
    By Lynda Huddleston in forum Alpha Five Version 5
    Replies: 11
    Last Post: 03-06-2005, 04:31 PM
  3. OnPrintExit Not Firing
    By Steve Buckler in forum Alpha Five Version 5
    Replies: 4
    Last Post: 11-11-2002, 06:47 AM
  4. Firing a Script Over and Over
    By Rhett Scott in forum Alpha Five Version 4
    Replies: 6
    Last Post: 08-30-2002, 06:15 PM
  5. OnActivate not firing
    By Steve Buckler in forum Alpha Five Version 4
    Replies: 4
    Last Post: 02-16-2001, 08:58 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •