Pregunta

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?

¿Fue útil?

Solución

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;
        }
    });

Otros consejos

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

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top