On 28 mai, 20:24, Rob Tanner <[email protected]> wrote:
> I'm rewriting some existing apps using GWT and I've come across a GUI
> issue.  In many cases where I have used a select element as a pull
> down menu (only 1 item visible at a time), I leave the first item
> empty and disabled.  The user has to choose a different option and he/
> she cannot go back to the empty element.  Using a ListBox, it's easy
> enough to leave the first element (index 0) empty.  But how do I
> disable that first element so that it can't be selected?

myListBox.getElement().<SelectElement>cast().getOptions().getItem(0).setDisabled(true);

Though there's no browser-compat code involved here, it's just an
equivalent to setting disabled=true on the option.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to