cancel
Showing results for 
Search instead for 
Did you mean: 

Autocomplete control with a large JSON array

Former Member
0 Kudos

Ok, I've been googling for a few days now trying to figure this out, but can't seem to find any references.  Trying a POC with autocomplete backended with a HANA Attribute view.

I'm binding a rather large JSONModel() to an AutoComplete control.  The JSON is coming from a local XS oData service that is frontending an AttributeView on SAP HANA One.  Chrome 31 is my target browser...

    oModel = new sap.ui.model.json.JSONModel();

    oModel.loadData(jsonURL);


           //Create a AutoComplete control and bind the items

          var oAuto = new sap.ui.commons.AutoComplete({

                    tooltip: "Enter a name",

                    width: "100%",

                    maxPopupItems: 5,

                    displaySecondaryValues: false,

                    items: {

                              path: "/d/results/",

                              template: new sap.ui.core.ListItem({text: "{NAME}"})

                    }

          });


           oAuto.setModel(oModel);

          //attach it to some element in the page

          oAuto.placeAt("autocomplete");

The JSONModel gets populated and I can see all 30,346 values in the results array.  However, the Autocomplete control at runtime only allows me to pull up the first 99 rows.  It seems to be linked to how the results are grouped in the JavaScript Console watch expression.

Wondering if I'm missing some key property which tells autocomplete to look at the whole array...

Thanks in advance,

Scott

Message was edited by: SCOTT PLETCHER

Accepted Solutions (1)

Accepted Solutions (1)

former_member91307
Contributor
0 Kudos

Hi Scott,

Use the method setSizeLimit

https://sapui5.netweaver.ondemand.com/sdk/#docs/api/symbols/sap.ui.model.Model.html#setSizeLimit

Thanks and regards, Venkatesh

Former Member
0 Kudos

Thank you sir.  Worked perfectly.  Now I just need to tweak my search filter.

Former Member
0 Kudos

Hi,

Even am facing the same issue but for me setSizeLimit is not working . Please look into the screenshot and help me out

Former Member
0 Kudos

Seems that SizeLimit is working according to your screenshot you set the limit to 1000 and you get 720 items which is less than 1000.

jmoors
Active Contributor
0 Kudos

The sizelimit needs to be set on the model, not the control. i.e.

oModel7.setSizeLimit(1000);

Answers (0)