Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I display all possible values in a SuggestBox

Tags:

gwt

I would like to display all possible values in a SuggestBox.

Naturally, I have the following code (settingName is a SuggestBox)

settingName.getTextBox().addFocusHandler(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.
like image 366
Sandro Munda Avatar asked Sep 23 '11 20:09

Sandro Munda


2 Answers

You need to set the defaults to show by suggestOracle.setDefaultSuggestionsFromText(..)

like image 138
pistolPanties Avatar answered Oct 23 '22 13:10

pistolPanties


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).

like image 36
Thomas Broyer Avatar answered Oct 23 '22 13:10

Thomas Broyer