0

I have a SearchField with liveChange properties:

<SearchField id="searchField" liveChange="onSearch" width="100%" />

In my controller i manage the live-action:

onSearch : function (oEvt) {

        // add filter for search
        var aFilters = [];
        var sQuery = oEvt.getSource().getValue();
        if (sQuery && sQuery.length > 0) {
          var fileterCol=this.byId("selectSearch789").getSelectedKey();
          var filter = new sap.ui.model.Filter(fileterCol, sap.ui.model.FilterOperator.Contains, sQuery);
          aFilters.push(filter);
        }

        // update list binding
        var tableArtConNom = this.getView().byId("tableResult");
        var binding = tableArtConNom.getBinding("items");
        binding.filter(aFilters, "Application");
    }

But at every char that I write, the cursor return al position 0. For example if I want search HOUSE i write the word but i see ESUOH....

If i use search and not liveChange it work!

1
  • I think you're suffering from something else... the code in the onSearch method doesn't indicate anything wrong. Do you somewhere else set the focus to the control? See this sample jsbin.com/ditado/1/edit?js,console,output using the code you provided (I commented out the parts to other controls)
    – Qualiture
    Aug 2, 2014 at 20:25

1 Answer 1

0

There is a solution for you. Please set property of SearchField: selectOnFocus="false".

Please also see the documentation.

Regards, Allen

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.