cancel
Showing results for 
Search instead for 
Did you mean: 
Subscribe

Hi,

I am using the SearchField to swiftly filter values in a large list. The list initially had 1023 entries and it worked fine. Now, the list has grown to 9963 entries and it has stopped working. Are there any SearchField limits? If yes, what are they?

Thanks!

0 Likes
View Entire Topic
bjorn-henrik_zink
Contributor
0 Likes

The error message I get is: Only "String" values are supported for the FilterOperator: "Contains". It leads me to think that it might be related to the data and not the volume.

How can I force the binding to be of type string of my model data for a specific column?

Here is my present code:


// filter list binding

var list = this.getView().byId("myList");

var binding = list.getBinding("items");

binding.filter(myFilters, "Application");

Thanks!

saivellanki
Active Contributor
0 Likes

Hi Bjorn,

Use a formatter, consider you have text as template (Just for an example, even though text is of string type):


new sap.m.Text({text:"{

                                   path:'Weight',

                                   formatter: function(v){

                                   return String(v);

                                   }

                              }"

                         });

Regards,

Sai Vellanki.

bjorn-henrik_zink
Contributor
0 Likes

Hi Sai,

thanks, we both had the same thought and I have now tested using a formatter. In fact, I replaced all the strings with "Test" and it results in the same error, i.e. it has nothing to do with the actual values and must be something with the size of the list. I will dig a bit further and keep the thread posted.

SergioG_TX
SAP Champion
SAP Champion
0 Likes

Bjorn,

can you post your code on how you created the filters as well? I am suspecting the issue being with the filter itself and maybe not necessarily with the binding

bjorn-henrik_zink
Contributor
0 Likes

Hi Sergio,

thanks for your reply, here is the filter code, hope you find something fishy or can help me force the column to be of type string:


var aFilters = [];

var sQuery = oEvt.getSource().getValue();


if (sQuery && sQuery.length > 0) {

       var filter = new Filter("someColumnName", sap.ui.model.FilterOperator.Contains, sQuery);

       aFilters.push(filter);

}

// Update list binding with filter

var list = this.getView().byId("searchList");

var binding = list.getBinding("items");

binding.filter(aFilters, "Application");

SergioG_TX
SAP Champion
SAP Champion
0 Likes

line 10...

binding.filter(aFilters); // try using this line instead of what you have

bjorn-henrik_zink
Contributor
0 Likes

I tried the code change, but no difference, the error persists 😞

SergioG_TX
SAP Champion
SAP Champion
0 Likes

in the chrome dev tools.. what is the value of sQuery ?

if not a string.. do.. sQuery.toString()... try this and see what happens next?

bjorn-henrik_zink
Contributor
0 Likes

Hi Sergio,

I've got liveChange on the search field and the entry is a string. Here's an example: