Open GoogleCodeExporter opened 9 years ago
look at documentation:
http://gwt-ext.com/docs/2.0.4/com/gwtext/client/widgets/form/ComboBox.html#selec
tByValue(java.lang.String,%20boolean)
Select an item in the dropdown list by its data value. This function does NOT
cause
the select event to fire. The store must be loaded and the list expanded for
this
function to work, otherwise use setValue.
Original comment by nietz...@gmail.com
on 16 Jul 2009 at 11:06
[deleted comment]
This is now a pretty old Thread, but as I just had to remind myself of how to
do this and stumbled on this Thread, I thought I'd quickly add a tip:
If you wish to select a value in the combo (which is bound to a Store), you use
the setValue, passing the value in which relates to the field that was
specified by using the setValueField method.
Let's say you have a store that has the fields: person_id and name
You will wish to specify that the value display is provided by the 'name' field
- by calling setDisplayField("name");
You will also need to tell the combo, that the actual value itself is
represented by the 'person_id' field
- by calling setValueField("person_id");
Now - to select the person whose person_id is 287, you can call:
- setValue("287");
The value will be selected as you wish, it will be displayed and all is good.
Hope that helps - Happy coding.
Peter Hedderley.
Original comment by peter.he...@googlemail.com
on 25 May 2011 at 9:34
Original issue reported on code.google.com by
fernando.rosado
on 17 Jun 2009 at 5:24