View Full Version : Set default Values to the SimpleComboBox
19 May 2009, 1:29 PM
I have a list i am assigned to the SimpleComboBox. I want to make one of the value in that list as the Default value.
List<String> list =new ArrayList<String>();
SimpleComboBox<String> combo=new SimpleComboBox<String>();
I want to make one of these value as default but it is not allowing me to that.
How can i do that?
20 May 2009, 1:46 AM
Have you tried this:
22 May 2009, 4:43 AM
SimpleComboBox<String> c = new SimpleComboBox<String>();
22 May 2009, 8:33 AM
I tried both ways ...it is not working
Is there any other way to set default values
5 Jun 2009, 4:51 AM
I have the same problem. Can anybody from support team help us?
12 Jun 2009, 7:23 AM
I'm not in support team ;-)
This is weird, setSimpleValue works fine for me. Are you sure there is no other problem ? Do your values (the choices) appear in the box ? Are you setting a value that exists in the list ?
14 Jun 2009, 10:54 PM
This works fine for me cmbType.setSimpleValue("All");
Here I want to set the default value as "All"
15 Jun 2009, 3:25 AM
Isn't that what you do ? If you programmatically set the value to "All", that's the default value for the box. Up to the user to accept the value or change it into another.
If you want all your comboboxes to have a default value "All" without calling setSimpleValue for every box, you could subclass SimpleComboBox and set the value in the contructor. In that case don't forget to populate the store in time.
15 Jun 2009, 3:39 AM
Yes. Using constructor way is good idea.
30 Jun 2009, 2:41 PM
In my scenario i have to set different values to each Combobox.
So I cannot use constructor to set default values.
I have generalized method it creates SimpleComboBox's and set it properties.
I will have Simplecombobox reference, based on the situation i will set default values to it.
Now i can set default values to it???
1 Jul 2009, 3:44 AM
yes having constructor is a way without that also, cmbType.setSimpleValue("whatever"); should work
1 Jul 2009, 8:23 AM
I am using like this...
///the name which i gave is already there in the dropdown list
but it is not set this value to the combobox
I am using GXT's FormBinding, i tried to assign same value to Object but that also not working.
Powered by vBulletin® Version 4.2.3 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.