Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Here is the Solution</p> <p>My Entry Point Class</p> <pre><code>public class SuggestionEntryPoint implements EntryPoint { @Override public void onModuleLoad() { SuggestBoxWidget suggestBoxWidget = new SuggestBoxWidget(); RootPanel rootPanel = RootPanel.get(); suggestBoxWidget.createOracle(); suggestBoxWidget.createWidgetAndShow(rootPanel); rootPanel.add(suggestBoxWidget); DOM.getElementById("loader").removeFromParent(); } } </code></pre> <p>And here is my Widget</p> <pre><code>public class SuggestBoxWidget extends Composite { private TextBox textSuggestBox = new TextBox(); private SuggestBox suggestBox = null; DefaultSuggestionDisplay suggestionDisplay = new DefaultSuggestionDisplay(); MultiWordSuggestOracle suggestOracle = new MultiWordSuggestOracle(); private static SuggestBoxWidgetUiBinder uiBinder = GWT .create(SuggestBoxWidgetUiBinder.class); interface SuggestBoxWidgetUiBinder extends UiBinder&lt;Widget, SuggestBoxWidget&gt; { } public SuggestBoxWidget() { initWidget(uiBinder.createAndBindUi(this)); } public void registerEvents(){ suggestBox.addKeyUpHandler(new KeyUpHandler() { @Override public void onKeyUp(KeyUpEvent event) { if(suggestBox.getText().equalsIgnoreCase("1")){ suggestionDisplay.hideSuggestions(); } } }); } public void createWidgetAndShow(HasWidgets container){ suggestBox = new SuggestBox(suggestOracle,textSuggestBox,suggestionDisplay); container.clear(); container.add(suggestBox); registerEvents(); } public void createOracle(){ for(int i=1;i&lt;=100;i++){ suggestOracle.add(i+""); } } } </code></pre> <p>Actually you have to create a SuggestBox with 3 Parameters to the Constructor.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload