我有以下gwt-bootstrap ui.xml:
<b:Typeahead ui:field="typeahead">
<b:TextBox ui:field="searchBox" searchQuery="true"
placeholder="Search..." />
</b:Typeahead>如何以编程方式获取typeahead项的建议响应“单击”,并将其设置为文本到搜索框中?
发布于 2013-03-06 19:08:26
因为我使用的是full gwt,所以Adarsha的答案在我的情况下并不是很有效。所以我的解决方案是:
typeahead.setUpdaterCallback(new Typeahead.UpdaterCallback() {
@Override
public String onSelection(Suggestion selectedSuggestion) {
String text = selectedSuggestion.getDisplayString();
return null;
}
});发布于 2013-02-28 21:39:35
下面的链接肯定会对你有帮助-
Get selected items value for Bootstrap's typeahead
一旦你得到了选定的值,就只需要做textbox.setValue(值)了。
https://stackoverflow.com/questions/15132717
复制相似问题