DropDown - AutoCompleting Event

Fired as the user enters a value in the edit, allowing for the value to be replaced with a new value

Member of DropDown (PRIM_LIST.DropDown)


NameTypeData TypeDescription
Value*BothUnicode StringCurrent value of the field and the replacement value to return
Handled*BothBooleanSet to true to stop the key being processed automatically


The AutoCompleting event provides an opportunity for the value to be completed as the user types.
The value entered is passed in to the event via the Value parameter.  The value can then be modified and returned to the edit.
Selection of characters within the edit is managed automatically.


In this example, the set of available items in the drop down is filtered based on the value entered.
Begin_Com Role(*EXTENDS #PRIM_WEB) Height(456) Width(864)
   Define_Com Class(#PRIM_LIst.DropDown) Name(#DropDown) ColumnHeaderHeight(0) DisplayPosition(1) Left(16) Parent(#COM_OWNER) RowLines(False) TabPosition(1) Top(16) Height(41) Width(241) DropDownStyle(DropDown)
   Define_Com Class(#PRIM_List.String) Name(#DropDownColumn) ColumnResize(False) ColumnUnits(Proportion) ColumnWidth(1) DisplayPosition(1) Parent(#DropDown)
   Evtroutine Handling(#Com_owner.CreateInstance)
      Begin_Loop To(100)
         Add_Entry To_List(#DropDown)
         #DropDownColumn.CurrentItem.Value := ("Item &1").Substitute( #DropDown.Items.ItemCount.AsString )
   Evtroutine Handling(#DropDown.AutoCompleting) Value(#Value) Handled(#Handled)
      #Handled := True
      Selectlist Named(#DropDown)
         #DropDown.CurrentItem.Visible := #DropDownColumn.CurrentItem.Value.Contains( #Value )

See also

All Component Classes

Technical Reference

LANSA Version 15, April 2020