DisplayOnly Property

This Q&A forum allows users to post and respond to "How Do I Do ....." questions. Please do not use to report (suspected) errors - you must use your regional help desk for this. The information contained in this forum has not been validated by LANSA and, as such, LANSA cannot guarantee the accuracy of the information.
Post Reply
davidbalansa
Posts: 47
Joined: Mon Feb 01, 2016 10:08 am
Location: Australia

DisplayOnly Property

Post by davidbalansa » Tue Oct 18, 2016 11:36 am

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.

davidbalansa
Posts: 47
Joined: Mon Feb 01, 2016 10:08 am
Location: Australia

Re: DisplayOnly Property

Post by davidbalansa » Tue Oct 18, 2016 1:44 pm

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.

Post Reply