Page 1 of 1

VLWeb event timing

Posted: Tue Jun 27, 2017 10:22 am
by soa
I have an application that sends data back to a server module and waits for a complete event. While its doing that it displays a status message to the user and spins a fontawesome icon. In the Event Handler for the complete event I turn off the status message and stop the spinner as below.

#APPLICATION.ACMEHideBusySpinner
#application.ACMEHideStatusBar

#SYS_WEB.Alert Caption(('Recording successfully uploaded.'))

The issue is that the Alert Pops up and the status bar is not hidden nor is the spinner stopped. This doesn't happen until the Alert is dismissed.

I assume this is related to threading etcetera but shouldn't the hide events continue once an Alert is displayed. Is there some way to force the hide events to complete before showing the alert?. Something like Doevents in vb. I've experimented with setting timers and Alert type code in the Timer Tick but this doesn't work consistently and complicates the code.

Any thoughts, anyone?

Re: VLWeb event timing

Posted: Tue Jun 27, 2017 10:56 am
by GregSippel
Soa,

To know what the effect you are experiencing might be related to I need to ask a few questions

Is the spinning icon made to spin via a #PRIM_ANIM with a #PRIM_ANIM.Rotate child component ?

Does the #APPLICATION.ACMEHideBusySpinner and #application.ACMEHideStatusBar methods signal an event which is the actioned code in another reusable part ?

What happen if you remove the #sys_web.alert ?

Have you tried displaying a #PRIM_PPNL instead of the #sys_web.alert ?

Regards
GregSippel

Re: VLWeb event timing

Posted: Tue Jun 27, 2017 11:47 am
by soa
Greg

The spinning icon is a fontawesome icon so the animation is managed by setting a css class.

Does the #APPLICATION.ACMEHideBusySpinner and #application.ACMEHideStatusBar methods signal an event which is the actioned code in another reusable part ? Yes.

I haven't tried a panel yet mainly because it seems to be overkill for a simple notification and I'm starting to suffer from Rp fatigue!

Re: VLWeb event timing

Posted: Tue Jun 27, 2017 12:04 pm
by dannyoorburg
Hi,

#SYS_WEB.Alert is basically just a JavaScript Alert.

When the Alert is up, NO other JavaScript runs, not your compiled RDML, not the LANSA runtime code. You're basically stuck on that statement until the user cancels the dialog.

I would use the LANSA message box instead, see:

http://docs.lansa.com/14/en/lansa016/PR ... ageBox.htm

Cheers,
Danny

Re: VLWeb event timing

Posted: Tue Jun 27, 2017 3:00 pm
by GregSippel
Soa,

As Danny says, no javascript would be running while the alert is up, so it is that rather than any issue with threading causing the issue I would think. This would mean the execution of the event would be stopped. If you remove the alert and all hide logic works then you know it is the cause.

For most applications I tend to create a generic application level message display mechanism. Either a message box, or android toast like display. They all tend to be based on #PRIM_PPNL. I have the RP parented to the web page as the top level object, and give it a reference to my application controller. I have a method that is part of the controller, that pass on a Title, message, display interval and what else need via an event to signaled by the method. Then the popup rps listens for the event, sets the values and displays itself.

The other suggestion I have (without knowing exactly what the application is trying to do or how it looks) would be to use a single event to close the status bar and high the busy spinner. If the spinner is inside the status bar, then by definition closing the status bar means icon is no longer required. Thus it can call a method to hide the spinner, or the spinner can know this event means it is no longer required.

Let me know how you get on, and if you need any help.

Regards
GregSippel