ItemChangedAccept event is triggered when an item is about to be changed
Member of Grid (PRIM_GRID)
Name | Type | Data Type | Description |
---|---|---|---|
Accept | *Both | Boolean | Set to false to prevent the change from being applied |
Reason | *Input | Enumeration | Action that triggered the event |
Continue | *Both | Boolean | Set to false to prevent focus moving to a different item |
Value | *Input | Variant | Value of the item as it changes |
The ItemChangedAccept event is triggered immediately before the update of the underlying list item. It is not a replacement for the ItemChanged event, instead providing an opportunity for edit processing to be interrupted. Set the Accept parameter to False to prevent focus changing. A number of different user actions can cause an ItemChangedAccept to fire. The Reason parameter contains an enumeration the provides feedback as to the cause.
This example shows how the accept and continue parameters affect behavior in a grid.
Function Options(*DIRECT) Begin_Com Role(*EXTENDS #PRIM_FORM) Clientwidth(792) Clientheight(394) Componentversion(2) Top(227) Left(222) Define_Com Class(#PRIM_GRID) Name(#Grid) Captionnoblanklines(True) Columnscroll(False) Componentversion(1) Displayposition(1) Height(337) Left(0) Parent(#COM_OWNER) Showselection(True) Showselectionhilight(False) Showsortarrow(True) Tabposition(1) Top(0) Width(792) Columnbuttonheight(25) Rowheight(28) Columnbuttonpress(True) Columnellipses(End) Frozencolumns(3) Define_Com Class(#PRIM_GDCL) Name(#GridColumn1) Displayposition(1) Parent(#Grid) Source(#EMPNO) Width(10) Widthtype(Fixed) Define_Com Class(#PRIM_GDCL) Name(#GridColumn2) Displayposition(2) Parent(#Grid) Source(#SURNAME) Width(18) Widthtype(Fixed) Readonly(False) Define_Com Class(#PRIM_GDCL) Name(#GridColumn3) Displayposition(3) Parent(#Grid) Source(#GIVENAME) Widthtype(Fixed) Readonly(False) Define_Com Class(#PRIM_CKBX) Name(#Accept) Caption('Accept value change?') Displayposition(2) Left(11) Marginleft(2) Parent(#COM_OWNER) Tabposition(2) Top(352) Width(214) Define_Com Class(#PRIM_CKBX) Name(#Continue) Caption('Continue to the next item?') Displayposition(3) Left(232) Marginleft(2) Parent(#COM_OWNER) Tabposition(3) Top(352) Width(241) Evtroutine Handling(#Com_Owner.CreateInstance) Select Fields(#Grid) From_File(pslmst) Add_Entry To_List(#Grid) Endselect Endroutine Evtroutine Handling(#Grid.ItemChangedAccept) Accept(#AcceptChange) Continue(#ContinueChange) #AcceptChange := #Accept.ButtonState = Checked #ContinueChange := #Continue.ButtonState = Checked Endroutine End_Com
Febuary 18 V14SP2