Focus of the second message box
Posted: Wed Jun 22, 2022 7:36 pm
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.
Best regards,
Taku
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
Taku