Saturday, May 29, 2010

Re: How do i implement in a ListBox a select options trick I do in HTML

On 28 mai, 20:24, Rob Tanner <caspersg...@gmail.com> 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 google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

No comments:

Post a Comment