How can I display all possible values in a SuggestBox
I would like to display all possible values in a SuggestBox.
Naturally, I have the following code (settingName is a SuggestBox)
settingName.getTextBox().addFocusHand开发者_开发问答ler(new FocusHandler() {
@Override
public void onFocus(FocusEvent event) {
settingName.showSuggestionList();
}
});
Unfortunately, the suggestbox displays anything. Of course, the settingName is associated to an oracle with several values inside it.
Am I crazy ?
According to the documentation :
public void showSuggestionList()
Show the current list of suggestions.
You need to set the defaults to show by suggestOracle.setDefaultSuggestionsFromText(..)
When showing the list, the SuggestBox
will ask the oracle for values to show. If the text box is empty, then requestDefaultSuggestions
will be called (which by default calls requestSuggestions
).
精彩评论