我已经实现了SearchField。当我单击“ X”按钮时,该值将被清除。光标在该字段中闪烁,但是没有填充建议。如果我再次在搜索字段中单击,则不会继续填充。 我必须单击页面上的其他位置,然后再次在搜索字段中单击以确保填充建议。如何处理“ X”?
View.xml
<SearchField class="" suggestionItems="{path:'model>/names'}" id="names"
value="{model>/header/names}" suggest="onSuggest" enableSuggestions="true" width="90%">
<suggestionItems>
<SuggestionItem key="{model>UserId}" text="{order>LastName} , {order>FirstName}"/>
</suggestionItems>
</SearchField>
Controller.js
onSuggest: function (oEvent) {
var value = oEvent.getParameter("suggestValue");
this.oSF = this.getView().byId("name");
this.oSF.getBinding("suggestionItems")
this.oSF.suggest();
答案 0 :(得分:0)
尝试过此attachEventOnce('dataReceived')解决方案吗?
顺便说一句:使用
this.oSF = oEvent.getSource()
代替
this.oSF = this.getView().byId("name");
会让您免于输入错误(名称<=>名称);-)