Page 1 of 1

Change Option for Combo Box Dynamically

Posted: Thu Apr 08, 2021 6:40 am
by benson_seb
How do I change format of displaying options in combo box .
I want to display options like
Value1=Option1,
value2=Option2

Thanks

Re: Change Option for Combo Box Dynamically

Posted: Thu Apr 08, 2021 10:49 am
by Scott Klement
Hello Benson,

Can you explain a little bit more about where the data is coming from? Are you loading values from a database file? Or are you coding them yourself in the properties? Or, how does it work?

Re: Change Option for Combo Box Dynamically

Posted: Fri Apr 16, 2021 2:34 am
by benson_seb
by default combo box is loaded with values from properties (choice and choice values).
Example: Currently Choice will be like Add, Edit, Delete and Choice Values will be 1,2,3
I need Choice :1=Add,2=Edit,3=Delete and Choice Values 1,2,3

I want this format for all combo boxes in the subfile.

Re: Change Option for Combo Box Dynamically

Posted: Fri Apr 16, 2021 9:52 am
by Scott Klement
So set the choices to 1=Add,2=Edit,3=Delete

Re: Change Option for Combo Box Dynamically

Posted: Mon Apr 19, 2021 7:52 am
by benson_seb
Some cases the option will be disabled .if i set the option manually it will display options always.so i need to be done dynamically. is there any way i can access the choice and choice values and set it in events onoptiondisplay

Re: Change Option for Combo Box Dynamically

Posted: Tue Apr 20, 2021 9:57 am
by benson_seb
for combowidget we get choices and values, two parameters in onoptiondisplay event,
using that parameters
i updated choices=values+"="+choices in the loop of i and i got the result.

In the description of onoptiondisplay event its mention parameter name as options, but its not working for me.
I used choices and it worked.

can i add addeventlistener in js file ,so that i do not required to change in every comboboxwidget?