Page 1 of 1

Focus of the second message box

Posted: Wed Jun 22, 2022 7:36 pm
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

Re: Focus of the second message box

Posted: Thu Jun 23, 2022 2:10 am
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).

Re: Focus of the second message box

Posted: Fri Jun 24, 2022 12:27 pm
by Taku Izumi
Hi Dino,

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

Regards,
Taku