
ItemGotFocusAccept is fired when the item gets focus
Member of List View (PRIM_LTVW)
Parameters
Name | Type | Data Type | Description |
---|---|---|---|
Accept | *Both | Boolean | Set to false to prevent the event from proceeding |
Reason | *Input | Enumeration | Action that triggered the event |
Details
The ItemGotFocusAccept event is triggered immediately before the ItemGotFocus event. It is not a replacement for the ItemGotFocus event, instead providing an opportunity for focus processing to be interrupted. Set the Accept parameter to False to prevent focus changing.
Example
In this example, focus can be set if the check box is checked.
Function Options(*DIRECT) Begin_Com Role(*EXTENDS #PRIM_FORM) Height(469) Left(228) Top(220) Width(686) Clientwidth(670) Clientheight(430) Define_Com Class(#PRIM_LTVW) Name(#ListView) Columnbuttonheight(19) Componentversion(2) Displayposition(1) Fullrowselect(True) Keyboardpositioning(SortColumn) Left(8) Parent(#COM_OWNER) Showsortarrow(True) Tabposition(1) Top(8) Height(377) Width(657) Define_Com Class(#PRIM_LVCL) Name(#LVCL1) Displayposition(1) Parent(#ListView) Source(#EMPNO) Width(33) Define_Com Class(#PRIM_LVCL) Name(#LVCL2) Displayposition(2) Parent(#ListView) Source(#SURNAME) Width(36) Define_Com Class(#PRIM_LVCL) Name(#LVCL3) Displayposition(3) Parent(#ListView) Source(#GIVENAME) Width(25) Define_Com Class(#PRIM_CKBX) Name(#AllowFocusChange) Caption('Allow Focus Change?') Displayposition(2) Left(8) Marginleft(2) Parent(#COM_OWNER) Tabposition(2) Top(391) Width(161) Buttonstate(Checked) Evtroutine Handling(#Com_owner.CreateInstance) Select Fields(#ListView) From_File(pslmst) Add_Entry To_List(#ListView) Endselect Endroutine Evtroutine Handling(#ListView.ItemGotFocusAccept) Accept(#Accept) #Accept := (#AllowFocusChange.buttonState = Checked) Endroutine Evtroutine Handling(#ListView.ItemGotFocus) #Com_owner.Caption += (#Empno + " ") Endroutine End_Com
See also
LANSA Version 15, April 2020