Um....now I'm stuck trying to populate the suggest box suggestions in
response to an event.
I want it to be so that if you press Enter in the suggest box it
behaves as though you had typed '*' in it.
final StartsWithSuggestOracle oracle = new
StartsWithSuggestOracle();
oracle.add("Aa");
oracle.add("Bb");
final SuggestBox sb = new SuggestBox(oracle);
sb.addKeyboardListener(new KeyboardListenerAdapter(){
public void onKeyPress(Widget widget, char c, int i) {
super.onKeyPress(widget, c, i);
if (c == KeyboardListener.KEY_ENTER && i == 0) {
SuggestOracle.Request req = new
SuggestOracle.Request("*");
oracle.requestSuggestions(req, new
SuggestOracle.Callback() {
public void
onSuggestionsReady(SuggestOracle.Request request,
SuggestOracle.Response response) {
//i dunno
//sb.setText("*"); // this works but it's
kludgey. i'd rather do it another way
}
});
}
}
});
So I think I'm missing something somewhere...how do I trigger
SuggestBox to give me the same response it would give me had I typed
something in?
Thanks....