Dropdown Item - Visible Property
Show or hide the item
Member of Dropdown Item (PRIM_MD.DropdownItem)
Data Type - Boolean
Details
Visible will return True if the item is visible.
Example
In this example, an items are visible only if the the caption value contains the value of the numeric field and if the field equals 0 all entrys are visible.
Begin_Com Role(*EXTENDS #PRIM_WEB) Theme(#SYS_THEME) Layoutmanager(#Layout1)
Define_Com Class(#PRIM_TBLO) Name(#Layout1)
Define_Com Class(#PRIM_TBLO.Row) Name(#Layout1Row1) Displayposition(1) Parent(#Layout1)
Define_Com Class(#PRIM_TBLO.Column) Name(#Layout1Column1) Displayposition(1) Parent(#Layout1)
Define_Com Class(#PRIM_TBLO.Item) Name(#Layout1Item1) Alignment(TopLeft) Column(#Layout1Column1) Manage(#SpinEdit) Parent(#Layout1) Row(#Layout1Row1) Sizing(FitToWidth) Flow(Down)
Define_Com Class(#PRIM_TBLO.Item) Name(#Layout1Item2) Alignment(TopLeft) Column(#Layout1Column1) Manage(#DropDown) Parent(#Layout1) Row(#Layout1Row1) Sizing(FitToWidth) Flow(Down)
Define_Com Class(#PRIM_MD.Dropdown) Name(#DropDown) Caption('Caption') Displayposition(1) Left(0) Parent(#COM_OWNER) Tabposition(1) Top(0) Width(1200)
Define_Com Class(#PRIM_MD.SpinEdit) Name(#SpinEdit) Caption('Caption') Displayposition(2) Left(0) Parent(#COM_OWNER) Tabposition(2) Top(75) Width(1200)
Evtroutine Handling(#COM_OWNER.Initialize)
Begin_Loop Using(#xDemoNumber) To(15)
#DropDown.Items.Add( #xDemoNumber.AsString )
End_Loop
Endroutine
Evtroutine Handling(#SpinEdit.Changed)
For Each(#entry) In(#DropDown.Items)
#entry.Visible := (#entry.Caption.AsNumber = #SpinEdit) Or (#SpinEdit = 0)
Endfor
Endroutine
End_Com