Ben Leitner
Ben Leitner

Reputation: 329

UiBinder wrongly thinks I have no addValueChangeHandler method

I have a class Selector<T> that extends ListBox and implements HasValue<T> (and thus HasValueChangeHandlers<T>) I then have:

@Override
public HandlerRegistration addValueChangeHandler(ValueChangeHandler<T> handler) {
  return addHandler(handler, ValueChangeEvent.getType());
}

I have a subclass of Selector, MessageListBox, which adds some extra functions for Selectors of certain special objects. I then have in one of my widgets...

@UiField MessageListBox<Column> filterColumnSelect;
...
@UiHandler("filterColumnSelect")
void handleSelectColumn(ChangeEvent event) {
  ((Button) add).setEnabled(filterColumnSelect.hasSelection());
}

And this works, but I want to change the method to actually listen to the ValueChangeEvent instead, because there are places in code where I generate one (and while I've since found how to create raw ChangeEvents, I'd rather not do that here). So, then I change the code to be...

@UiField MessageListBox<Column> filterColumnSelect;
...
@UiHandler("filterColumnSelect")
void handleSelectColumn(ValueChangeEvent<Column> event) {
  ((Button) add).setEnabled(filterColumnSelect.hasSelection());
}

But now GWT fails to compile with: [ERROR] Field 'filterColumnSelect' does not have an 'addValueChangeHandler' method associated.

um... yes it does, it inherits it from Selector, and all these classes are public. what gives?

Also, as a note, I looked at ValueListBox as well, but there are features I need that it doesn't support, so that's out.

Upvotes: 0

Views: 733

Answers (1)

Thomas Broyer
Thomas Broyer

Reputation: 64541

This is a known bug. It's been fixed already and will ship in GWT 2.6.

Upvotes: 2

Related Questions