我已经实现了一个SearchField。当我单击“X”按钮时,该值将被清除。光标在字段中闪烁,但建议不会填充。如果我再次在搜索字段中单击仍然不填充。我必须单击页面上的其他位置,然后再次单击搜索字段以确保填充建议。如何处理“X”?
VIE W上。 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();
试过这个attachEventOnce('dataReceived')解决方案?
顺便说一句:使用
this.oSF = oEvent.getSource()
代替
this.oSF = this.getView().byId("name");
将错误的错别字(姓名<=>名称);-)