Hi, I've tried to add a selection handler to a suggestbox onSelection
where I expect that the Suggestion is my UserSuggestion that extends
IsSerializable and Suggestion but eclipse is having some objections:
The method addSelectionHandler
(SelectionHandler<SuggestOracle.Suggestion>) in the type SuggestBox is
not applicable for the arguments (new SelectionHandler<UserSuggestion>
(){})

suggestBox.addSelectionHandler(new SelectionHandler<UserSuggestion>(){

                        public void onSelection(SelectionEvent<UserSuggestion> 
event) {
                                Long id = event.getSelectedItem().getId();
                                RootPanel.get("").add(new Label(id));
                        }

                });

looking at the SuggestBox sources, would a raw type that extends
Suggestion do the trick (and would the gwt compiler know how to
translate to javascript)?

  public HandlerRegistration addSelectionHandler(
      SelectionHandler<Suggestion> handler) {
    return addHandler(handler, SelectionEvent.getType());
  }

  public HandlerRegistration addSelectionHandler(
      SelectionHandler<? extends Suggestion> handler) {
    return addHandler(handler, SelectionEvent.getType());
  }

--~--~---------~--~----~------------~-------~--~----~
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