private void setSelectedValue(ListBox lBox, String str) {
String text = str;
int indexToFind = -1;
for (int i = 0; i < lBox.getItemCount(); i++) {
if (lBox.getValue(i).equals(text)) {
indexToFind = i;
break;
}
}
lBox.setSelectedIndex(indexToFind);
}

On Friday, May 30, 2014 at 9:42:24 PM UTC+5:30, Steve C wrote:
>
> One of the first things I ever put into my personal utility classes module 
> was an extension of ListBox to have setValue(String) and getValue(String) 
> methods.
>
> Or, you could use ValueListBox instead of ListBox, but it's kind of a pain 
> to work with due to the need for a Renderer.  (But, it does allow the use 
> of object values, not just Strings).
>
> On Thursday, May 29, 2014 5:58:48 AM UTC-4, Ivano Vingiani wrote:
>>
>> Create a Widget that extends (or wrap) ListBox that implements 
>> setValue(value)
>>
>> On Wednesday, May 20, 2009 8:32:22 AM UTC+1, zeroonea wrote:
>>>
>>> when i load data to form to edit, how i set selected item in listbox 
>>> by value
>>
>>

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

Reply via email to