In the past I have been able to dynamically set fields and dropdowns in a Windows VL UI using collections and setting the ReadOnly property.
In VL Web there is a great new property DisplayOnly which not only sets the component to read only but also automatically changes its appearance. So I want to use it instead of the ReadOnly property.
The ReadOnly property is found in the #prim_evp class so I can build a collection of #prim_evp to store my screen fields then manipulate the collection to set all my fields to be read only.
I can't seem to locate the class where the DisplayOnly property so I can create my collection and manipulate the DisplayOnly property of my screen fields. Can you tell me the base class I should be using?
A second question is that the DisplayOnly property does not exist for dropdown components. Will this be implemented in the future? At the moment I have to create a reusable part with a dropdown (input) and a field (read only) and display the appropriate one when setting it to read only.
Below is the code I use to set the readonly property:
* Control Collections
Define_Com Class(#prim_acol<#prim_evp>) Name(#ComponentFields)
Define_Com Class(#prim_acol<#prim_list.dropDown>) Name(#ComponentDropDowns)
* Loading the Control Collections
For Each(#control) In(#Panel.ComponentControls)
If_Ref Com(#control) Is(*INSTANCE_OF #prim_evp)
Set_Ref Com(#PartField) To(*dynamic #control)
#ComponentFields.Insert Item(#PartField)
Endif
If_Ref Com(#control) Is(*INSTANCE_OF #prim_list.dropDown)
Set_Ref Com(#PartDropDown) To(*dynamic #control)
#ComponentDropDowns.Insert Item(#PartDropDown)
Endif
Endfor
*Setting the Components to ReadOnly
#ComponentFields<>.ReadOnly := #WK_ReadOnly
#ComponentDropDowns<>.ReadOnly := #WK_ReadOnly
Thanks in advance
David.
DisplayOnly Property
-
davidbalansa
- Posts: 92
- Joined: Mon Feb 01, 2016 10:08 am
Re: DisplayOnly Property
I found the class I was looking for. Instead of using #prim_evp, I can use #prim_evef which gives me access to the DisplayOnly property.