Page 1 of 1

Making a dropdown DisplayOnly

Posted: Wed Nov 11, 2020 6:10 am
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!

Re: Making a dropdown DisplayOnly

Posted: Thu Nov 12, 2020 12:38 am
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 5319 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

Re: Making a dropdown DisplayOnly

Posted: Thu Nov 12, 2020 1:44 am
by ESODevKJ
Thank you for your help! Much appreciated.