PRIM_MD.Alert - duration

This Q&A forum allows users to post and respond to "How Do I Do ....." questions. Please do not use to report (suspected) errors - you must use your regional help desk for this. The information contained in this forum has not been validated by LANSA and, as such, LANSA cannot guarantee the accuracy of the information.
Post Reply
adale
Posts: 210
Joined: Wed Apr 08, 2020 9:18 pm
Location: Poplarville, MS

PRIM_MD.Alert - duration

Post by adale »

I am having an issue with the PRIM_MD.Alert parm "duration" in a current VL web application. The "duration" time does not seem to have any impact, as the Alert just stays present until closed via user intervention.
If it makes a difference I am at EPC 150070.

Am I handling the duration parm incorrectly either in the Define, or in the Evtroutine?
I have left the Duration parm in the Define, I have also removed the Duration parm in the Define, but either way it doesn't seem to make a difference.

Is there some other parm I have that might be in conflict with the Duration?


Simple vl web page sample:

Code: Select all

* Test web page with an Alert in web page, may need to create in a view, or dialog?

BEGIN_COM Role(*EXTENDS #PRIM_WEB) Theme(#SYS_THEME<MaterialDesignBlue>)

DEFINE_COM Class(#PRIM_MD.Alert) Name(#Alert) Caption('Info! This Alert could indicate a neutral information change or action') Displayposition(1) Duration(3000) Left(72) Parent(#COM_OWNER) Tabposition(1) Themedrawstyle('LightTitle') Top(120)

DEFINE_COM Class(#PRIM_MD.RaisedButton) Name(#Button) Caption('SHOW ALERT') Displayposition(2) Left(72) Parent(#COM_OWNER) Tabposition(2) Themedrawstyle('MediumTitle') Top(50)

EVTROUTINE Handling(#Com_owner.Initialize)

ENDROUTINE

EVTROUTINE Handling(#Button.Click)
#Alert.Visible := True
#Alert.Duration := 1500
#Alert.Caption := 'Alert to display for 1.5 seconds'
ENDROUTINE

END_COM
Arlyn Dale
Servias LLC
JamesDuignan
Posts: 85
Joined: Thu Nov 26, 2015 1:43 pm

Re: PRIM_MD.Alert - duration

Post by JamesDuignan »

Hi Arlyn,

The duration is not applicable to the visible property. What you need to use to utilies the duration is the showAlert method.

e.g.

Code: Select all

Evtroutine Handling(#Button.Click)
* #Alert.Visible := True
#Alert.Duration := 1500
#Alert.Caption := 'Alert to display for 1.5 seconds'

#Alert.ShowAlert

Endroutine
Cheers,
James
adale
Posts: 210
Joined: Wed Apr 08, 2020 9:18 pm
Location: Poplarville, MS

Re: PRIM_MD.Alert - duration

Post by adale »

Got it!
Thanks.
Arlyn Dale
Servias LLC
Post Reply