Options for "Modal" Popup VL-WEB

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
atostaine
Posts: 317
Joined: Wed Jan 20, 2016 7:38 am

Options for "Modal" Popup VL-WEB

Post by atostaine » Fri Feb 08, 2019 3:54 am

I need a popup that I can force the users to click yes or no before it is dismissed. Do I have to do another page?

I set autoclose no, close on click no, etc, the popup will still go away.

Thanks, Art
Art Tostaine

jyoung
Posts: 590
Joined: Thu Jan 21, 2016 6:43 am
Location: Oklahoma City, OK USA

Re: Options for "Modal" Popup VL-WEB

Post by jyoung » Fri Feb 08, 2019 4:31 am

Hey Art,

You may want to make sure you are getting the latest script. i.e. do a hard refresh.

I use popups like this all the time and every time time it seems like it does not work its because the browser had an outdated script.

Here is a simple sample to compare with. The only way to close the popup is to press the close button.

Code: Select all

begin_com role(*EXTENDS #PRIM_WEB) Theme(#SYS_THEME<MaterialDesignBlue>)

define_com class(#PRIM_MD.RaisedButton) name(#Button) Caption('Show Popup') DisplayPosition(1) Left(118) Parent(#COM_OWNER) TabPosition(1) ThemeDrawStyle('MediumTitle') Top(221)
define_com class(#PRIM_PPNL) name(#Popup1) Left(471) Parent(#COM_OWNER) TitleBar(True) Top(179) AutoClose(False) Caption('You Must Close Me')
define_com class(#PRIM_MD.RaisedButton) name(#Button1) Caption('Close') DisplayPosition(1) Left(88) Parent(#Popup1) TabPosition(1) ThemeDrawStyle('MediumAccent') Top(48)

evtroutine handling(#Com_owner.Initialize)

endroutine


evtroutine handling(#Button.Click)
#Popup1.ShowPopup
endroutine

evtroutine handling(#Button1.Click)
#Popup1.ClosePopup
endroutine
end_com
Hope this helps,
Joe

atostaine
Posts: 317
Joined: Wed Jan 20, 2016 7:38 am

Re: Options for "Modal" Popup VL-WEB

Post by atostaine » Fri Feb 08, 2019 4:43 am

Thanks Joe. My popup keeps losing the autoclose(false) property. I'll see if I can duplicate it and send that to support.

There are fields under my popup and they aren't disabled automatically. I'll have to disable everything before I show the popup.

Code: Select all

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

Define_Com Class(#PRIM_MD.RaisedButton) Name(#Button) Caption('Show Popup') Displayposition(1) Left(118) Parent(#COM_OWNER) Tabposition(1) Themedrawstyle('MediumTitle') Top(221)
Define_Com Class(#PRIM_PPNL) Name(#Popup1) Left(471) Parent(#COM_OWNER) Titlebar(True) Top(179) Autoclose(False) Caption('You Must Close Me')
Define_Com Class(#PRIM_MD.RaisedButton) Name(#Button1) Caption('Close') Displayposition(1) Left(88) Parent(#Popup1) Tabposition(1) Themedrawstyle('MediumAccent') Top(48)
Define_Com Class(#STD_DESC.EditField) Name(#STD_DESC) Displayposition(3) Left(106) Parent(#COM_OWNER) Tabposition(3) Top(70)

evtroutine handling(#Com_owner.Initialize)

endroutine


evtroutine handling(#Button.Click)
#Popup1.ShowPopup
endroutine

evtroutine handling(#Button1.Click)
#Popup1.ClosePopup
endroutine
end_com

Art
Art Tostaine

MarkD
Posts: 485
Joined: Wed Dec 02, 2015 9:56 am

Re: Options for "Modal" Popup VL-WEB

Post by MarkD » Fri Feb 08, 2019 9:13 am

I find that quite often #Sys_Web.Confirm can handle the yes/no situations:

Code: Select all

Define_Com Class(#Prim_Boln) Name(#ProceedwithDelete)
#ProceedwithDelete := #SYS_WEB.Confirm( "Delete this record?" ) = OK
It will show OK or Cancel, but you can usually word the question that way.

Capture.PNG
Capture.PNG (16.13 KiB) Viewed 41 times

Post Reply