List View - ItemLostSelectionAccept Event

Fired when an item in the list is about to lose selection

Member of List View (PRIM_LTVW)

Parameters

NameTypeData TypeDescription
Accept*BothBooleanSet to false to prevent the event from proceeding
Reason*InputEnumerationAction that triggered the event

Details

The ItemLostSelectionAccept event is triggered immediately before the ItemLostSelection event.
 
It is not a replacement for the ItemLostSelection event, instead providing an opportunity for selection processing to be interrupted.
 
Set the Accept parameter to False to prevent selection changing.

Example

In this example, selection can be changed if the check box is checked.
Function Options(*DIRECT)
Begin_Com Role(*EXTENDS #PRIM_FORM) Height(469) Left(332) Top(244) 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(#AllowSelectionChange) Caption('Allow Selection 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.ItemGotSelectionAccept #ListView.ItemLostSelectionAccept) Accept(#Accept)
 
         #Accept := (#AllowSelectionChange.buttonState = Checked)
 
      Endroutine
 
      Evtroutine Handling(#ListView.ItemLostSelection)
 
         #Com_owner.Caption += (#Empno + " ")
 
      Endroutine
 
End_Com

See also

All Component Classes

Technical Reference

Febuary 18 V14SP2