Focus of the second message box

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
Taku Izumi
Posts: 70
Joined: Thu Dec 15, 2016 2:03 pm

Focus of the second message box

Post by Taku Izumi »

Hi All,

When using multiple messagebox controls on a web page, the first displayed message box will be autofocused, but the second one will not be focused.
Is there a way to autofocus on the second message box?

This is a test case.
The first message box is closed with the Enter key, but the second is not closed because the focus is on the web page.

Code: Select all

Begin_Com Role(*EXTENDS #PRIM_WEB) Theme(#SYS_THEME<MaterialDesignBlue>) Height(464) Width(1160) Layoutmanager(#LayoutMain)

* MessageBox
Define_Com Class(#PRIM_TBLO) Name(#LayoutMain)
Define_Com Class(#PRIM_TBLO.Column) Name(#LayoutMainColumn1) Displayposition(1) Parent(#LayoutMain)
Define_Com Class(#PRIM_TBLO.Row) Name(#LayoutMainRow1) Displayposition(1) Parent(#LayoutMain) Height(80) Units(Pixels)
Define_Com Class(#PRIM_TBLO.Row) Name(#LayoutMainRow2) Displayposition(2) Parent(#LayoutMain)
Define_Com Class(#PRIM_TBLO.Item) Name(#LayoutMainItem1) Manage(#Button) Parent(#LayoutMain) Row(#LayoutMainRow1) Sizing(None) Column(#LayoutMainColumn1) Alignment(CenterLeft)
Define_Com Class(#PRIM_TBLO.Item) Name(#LayoutMainItem2) Alignment(TopCenter) Column(#LayoutMainColumn1) Manage(#List) Parent(#LayoutMain) Row(#LayoutMainRow2)

Define_Com Class(#PRIM_WEB.MessageBox) Name(#MsgBox_First) Caption('Show First') Title('First')
Define_Com Class(#PRIM_WEB.MessageBox) Name(#MsgBox_Second) Caption('Show Second') Title('Show Second')

Define_Com Class(#PRIM_MD.RaisedButton) Name(#Button) Caption('MessageBox Show') Displayposition(1) Left(0) Parent(#COM_OWNER) Tabposition(1) Themedrawstyle('MediumTitle') Top(22) Width(327)
Define_Com Class(#PRIM_LIST) Name(#List) Columnheaderheight(0) Columnlines(False) Displayposition(2) Height(384) Left(0) Parent(#COM_OWNER) Rowheight(48) Tabposition(2) Top(80) Width(1160) Treebuttons(False)
Define_Com Class(#PRIM_LIST.String) Name(#ListColumn1) Columnwidth(968) Displayposition(1) Parent(#List) Sortonclick(True) Source(#STD_TEXTL)

Evtroutine Handling(#Button.Click)
#MsgBox_First.Show
Endroutine

Evtroutine Handling(#MsgBox_First.Closed)
#STD_TEXTL := 'MsgBox_First.Result = ' + #MsgBox_First.Result
Add_Entry To_List(#List)
#MsgBox_Second.Show
Endroutine

Evtroutine Handling(#MsgBox_Second.Closed)
#STD_TEXTL := 'MsgBox_Second.Result = ' + #MsgBox_Second.Result
Add_Entry To_List(#List)
Endroutine

End_Com
Best regards,
Taku
User avatar
Dino
Posts: 477
Joined: Fri Jul 19, 2019 7:49 am
Location: Robbinsville, NC
Contact:

Re: Focus of the second message box

Post by Dino »

Hi Taku

I tried your web page and show the same result in V15 150040... I'll suggest you open a case (https://lansa.com/support/helpdesk.html#am),
most likely either a defect (if making #MsgBox_Second.Show should automatically make his close button the default button), or an enhancement (to have the ability to indicate the set the focus in this kind of component).
Taku Izumi
Posts: 70
Joined: Thu Dec 15, 2016 2:03 pm

Re: Focus of the second message box

Post by Taku Izumi »

Hi Dino,

Thank you for trying my test case.
I will report this issue for LANSA Support team.

Regards,
Taku
Post Reply