Dynamically set the visiblility of #PRIM_MD.ListIcon
Posted: Tue Dec 18, 2018 8:12 am
I need to dynamically set the Visible property on the #PRIM_MD.ListIcon if the list is being view on a mobile device
Here is the list.
Here is the code I'm trying to execute without success. On my log. all I'm getting is TREEITEM which makes no sense.
What changes do I need to make to set the visibility of the #PRIM_MD.ListIcon
Here is the list.
Code: Select all
Define_Com Class(#PRIM_MD.List) Name(#List) Displayposition(2) Layoutmanager(#LayoutList) Left(0) Parent(#COM_OWNER) Rowheight(89) Tabposition(1) Top(0) Itemsperrow(5) Height(449) Width(633)
Define_Com Class(#PRIM_MD.ListLabel) Name(#ListFS02_Name) Caption('Name') Displayposition(1) Height(20) Parent(#List) Tabposition(1) Width(106) Source(#FS02_Name) Top(5)
Define_Com Class(#PRIM_MD.ListLabel) Name(#ListFS02_Class) Caption('Class') Displayposition(4) Height(20) Parent(#List) Tabposition(3) Top(25) Width(106) Source(#FS02_Class) Themedrawstyle('ForegroundSecondary')
Define_Com Class(#PRIM_MD.ListLabel) Name(#ListFS02_Subclass) Caption('Sub-Class') Displayposition(5) Height(20) Parent(#List) Tabposition(4) Top(45) Width(106) Source(#FS02_Subclass) Themedrawstyle('ForegroundSecondary')
Define_Com Class(#PRIM_MD.ListLabel) Name(#ListFS02_PhoneNbr1) Caption('Phone') Displayposition(6) Height(20) Parent(#List) Tabposition(5) Top(65) Width(106) Source(#FS02_PhoneNbr1) Themedrawstyle('ForegroundSecondary')
Define_Com Class(#PRIM_MD.ListIcon) Name(#PhoneIcon) Displayposition(2) Icon('phone') Parent(#List) Tabposition(8) Left(68) Top(20)What changes do I need to make to set the visibility of the #PRIM_MD.ListIcon
Code: Select all
For Each(#Item) In(#List.Items)
#SYS_WEB.Console.Log( ('Prepare: ' + #Item.Name.UpperCase) )
#SYS_WEB.Console.Log( ('Prepare: ' + #Item.ComponentClassName) )
#SYS_WEB.Console.Log( ('Prepare Mobile: ' + #Sys_Web.Device) )
If Cond(#Item.Name.UpperCase = ('PhoneIcon').UpperCase)
If Cond(#Sys_Web.Device *EQ Mobile)
#Item.Visible := True
Else
#Item.Visible := False
Endif
Endif
Endfor