Saturday, November 24, 2012

Re: gwt suggestbox.

Spent some time on it today and got it working, thanks Thomas!!

public class PietSuggestOracle extends SuggestOracle {

public static class PietSuggestion implements SuggestOracle.Suggestion {
private String displayString = "";
private String replacementString = "";
public PietSuggestion(String displayString, String replacementString){
this.displayString = displayString;
this.replacementString = replacementString;
}
@Override
public String getDisplayString() {
return this.displayString;
}

@Override
public String getReplacementString() {
return this.replacementString;
}
}
@Override
public void requestSuggestions(final Request request, final Callback callback) {
LinkedList<PietSuggestion> suggestions = new LinkedList<PietSuggestOracle.PietSuggestion>();
PietSuggestion suggestion1 = new PietSuggestion("TEST1", "TEST1");
suggestions.add(suggestion1);
PietSuggestion suggestion2 = new PietSuggestion("TEST2", "TEST2");
suggestions.add(suggestion2);
PietSuggestion suggestion3 = new PietSuggestion("TEST3", "TEST3");
suggestions.add(suggestion3);
Response response = new Response(suggestions);        
callback.onSuggestionsReady(request, response);
}

}


On Thursday, 22 November 2012 10:53:47 UTC+2, Thomas Broyer wrote:


On Thursday, November 22, 2012 6:03:57 AM UTC+1, Jan Vladimir Mostert wrote:
Hi, sorry for re-opening a topic from 2009.

In the above code, you said nameCallback = callBack, where is this nameCallback being used?
I don't quite understand how to use the callback.

I was just wondering if there's a full implementation / example available on how to extend the SuggestOracle using RPC.


--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/-JAYBToyawkJ.
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