Dropdown items - Add Method

Add an item to the dropdown

Member of Dropdown items (PRIM_MD.DropdownItems)

Parameters

NameTypeData TypeDescription
Result*Result (Optional)PRIM_MD.DropdownItemReference to the new item instance
Value*InputStringUnderlying value for the item
Caption*Input (Optional)StringValue to be displayed for a dropdown entry

Details

The Add method is used to add items to the Dropdown.
 
This is the equivalent of using the ADD_ENTRY command.

Example

Clicking the Add button will add more items to the Dropdown
Begin_Com Role(*EXTENDS #PRIM_WEB) Height(408) Width(809)
 
   Define_Com Class(#PRIM_MD.Dropdown) Name(#DropDown) DisplayPosition(1) Label('DropDown') Left(35) Parent(#COM_OWNER) TabPosition(1) Top(16)
   Define_Com Class(#PRIM_MD.FlatButton) Name(#Button) Caption('Add') DisplayPosition(2) Left(301) Parent(#COM_OWNER) TabPosition(2) Top(38)
 
   Evtroutine Handling(#Com_owner.CreateInstance)
 
      Begin_Loop To(3)
         #DropDown.Items.Add( ("Item &1").Substitute( (#DropDown.Items.ItemCount + 1).AsString ) )
      End_Loop
 
   Endroutine
 
   Evtroutine Handling(#Button.Click)
 
      #DropDown.Items.Add( ("Item &1").Substitute( (#DropDown.Items.ItemCount + 1).AsString ) )
 
   Endroutine
 
End_Com

See also

All Component Classes

Technical Reference

V14SP2 April 2018