Making a dropdown DisplayOnly

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
ESODevKJ
Posts: 31
Joined: Tue Nov 10, 2020 9:07 am

Making a dropdown DisplayOnly

Post by ESODevKJ »

Hi All,

Trying to make my dropdown display only. Looking at other posts, I think I have to make the class prim_evef, but I get an error whenever I try to change #DropDown1.ReadOnly to DisplayOnly. Here's what I have:

Code: Select all

Define_Com Class(#PRIM_LIST.Dropdown) Name(#DropDown1) Columnheaderheight(0) Columnlines(False) Displayposition(1) Left(0) Parent(#COM_OWNER) Rowlines(False) Showselection(False) Tabposition(1) Height(19) Top(0) Width(225)


If (#Context *Is #prim_evef)

#DropDown1.ReadOnly := (#Context *As #prim_evef).DisplayOnly

Endif
Thanks, any help is much appreciated!
User avatar
Dino
Posts: 477
Joined: Fri Jul 19, 2019 7:49 am
Location: Robbinsville, NC
Contact:

Re: Making a dropdown DisplayOnly

Post by Dino »

Hi

If you don't want the user to be able to change the value, ReadOnly TRUE should be enough.
If you don't want the user to be able to see the other possible values in the dropdown, Enabled FALSE will do the trick.
testdd1.jpg
testdd1.jpg (138.16 KiB) Viewed 5318 times
Begin_Com Role(*EXTENDS #PRIM_WEB) Theme(#SYS_THEME<MaterialDesignBlue>)

Define_Com Class(#PRIM_LIST.Dropdown) Name(#DropDown1) Columnheaderheight(0) Columnlines(False) Displayposition(1) Left(0) Parent(#COM_OWNER) Rowlines(False) Showselection(False) Tabposition(1) Height(19) Top(0) Width(225)
Define_Com Class(#PRIM_LIST.String) Name(#DropDown1Column1) Columnunits(Proportion) Columnwidth(1) Displayposition(1) Parent(#DropDown1) Sortonclick(True) Source(#STD_NAME)

Evtroutine Handling(#Com_owner.Initialize)
#STD_NAME := AAA
Add_Entry
#STD_NAME := BBB
Add_Entry
#STD_NAME := CCC
Add_Entry
Get_Entry Number(2) From_List(#DropDown1)
#DropDown1.CurrentItem.Focus := True

#DropDown1.ReadOnly := True
#Dropdown1.Enabled := False
Endroutine

End_Com
ESODevKJ
Posts: 31
Joined: Tue Nov 10, 2020 9:07 am

Re: Making a dropdown DisplayOnly

Post by ESODevKJ »

Thank you for your help! Much appreciated.
Post Reply