Gwt 如何使用Bootstrap Typeahead的选定值设置文本框值?

Gwt 如何使用Bootstrap Typeahead的选定值设置文本框值?,gwt,uibinder,gwt-bootstrap,Gwt,Uibinder,Gwt Bootstrap,我有以下gwt bootstrap ui.xml: <b:Typeahead ui:field="typeahead"> <b:TextBox ui:field="searchBox" searchQuery="true" placeholder="Search..." /> </b:Typeahead> 如何以编程方式获取typeahead项的“单击”建议响应,并将其设置为搜索框中的文本 下面的链接肯定会帮助您- 一旦你得到了所选的值

我有以下gwt bootstrap ui.xml:

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


如何以编程方式获取typeahead项的“单击”建议响应,并将其设置为搜索框中的文本

下面的链接肯定会帮助您-


一旦你得到了所选的值,只需执行textbox.setValue(value)。

那么Adarsha答案在我的情况下就不起作用了,因为我使用的是完整的gwt。因此,我的解决方案是:

typeahead.setUpdaterCallback(new Typeahead.UpdaterCallback() {

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