Question

I have the following gwt-bootstrap ui.xml :

<b:Typeahead ui:field="typeahead">
   <b:TextBox ui:field="searchBox" searchQuery="true"
     placeholder="Search..." />
</b:Typeahead>

How can i programmatically take the suggested response "On Click" of the the typeahead item and set it as Text into the searchbox?

Was it helpful?

Solution

Well the Adarsha Answer dont really work in my case, because i use full gwt. So my Solution is :

typeahead.setUpdaterCallback(new Typeahead.UpdaterCallback() {

        @Override
        public String onSelection(Suggestion selectedSuggestion) {
            String text = selectedSuggestion.getDisplayString();
            return null;
        }
    });

OTHER TIPS

The below link will definitely helps you -

Get selected items value for Bootstrap's typeahead

once you get the selected value its just a matter of doing textbox.setValue(value).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top