On 25 oct, 17:40, Emerson Matsuuchi <ema...@gmail.com> wrote:
> I have a issue that I'm trying to resolve and it may be something
> simple that I'm completely overlooking. I have a ListBox that has a
> ChangeHandler registered with it. I would like to programatically
> change the value of the ListBox and have an event fired that I can
> listen for. Unfortunately programatically changing the value does not
> fire an event to the ChangeHandler. While searching the internet I
> only came across disturbingly unelegant solutions to this problem
> (which I'm also convinced will not resolve the problem). I also have
> several TextBox objects that I can simply call setValue("some string",
> true) to fire an event to a ValueChangeHandler. The ListBox does not
> have a corresponding mechanism to fire an event. If anyone has any
> suggestions on how to tackle this problem, that would be greatly
> appreciated.
Because a ChangeEvent is a DomEvent, it's a bit less easy to fire one
than a ValueChangeEvent. Try this:
DomEvent.fireNativeEvent(Document.get().createChangeEvent(),
myListBox);
...or implement an HasValue or HasValueChangeHandlers wrapping your
ListBox (you can use HasValue<String>, HasValue<Integer>,
HasValue<String[]> or HasValue<Integer[]>, that's why ListBox doesn't
itself implement HasValue)
--~--~---------~--~----~------------~-------~--~----~
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/google-web-toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---