Skip to Content
Technical Articles
Author's profile photo Nikhil Dixit

sap.m.ComboBox and Table Shows only 100 items

Hello Everyone

While developing the application using ComboBox we all have seen that default items shows only up to 100 records.

Control like Table and List support Paging and directly ask the list binding for the needed data for example when scrolling down. Other controls might not support this. In this case the size limit of the model is used.

We can change the size limit of Model to needed range.

                var that = this;
                var newArray = new Array();
                var oModel = new sap.ui.model.json.JSONModel();
                this.getData(function (data){
                    each(data.Countries,function(index, countrie){
                        var newData = merge({
                            "flag":"png100px/" + countrie.CountryCode.toLowerCase() + ".png"
                        },countrie);
                        newArray.push(newData);
                    });
                    oModel.setSizeLimit(300);
                    oModel.setData(newArray);
                    that.getView().setModel(oModel, "covid");
                    debugger;
                });

View

 <Table id="CovidTableid" items="{covid>/}" visible="false">
   

Now Table can show up to 300 as the Model size limit is set to 300.

But wile working with ComboBox we can also add the Limit by setting length in items.

<ComboBox id="TaxCodeCID" change="handelTaxCode" items="{path : '/ZTAXCODESet', length : '500'}">
  <core:ListItem id="TaxCodeListID" key="{WITHT}" text="{DROP_DOWN}"/>
</ComboBox>
items=”{path : ‘/Your path’, length : ‘500’}
Now you can see the Records up to 500 by increasing the size limit of your model or defining the length can work.
You can refer the https://sapui5.hana.ondemand.com/  for particular properties of a control in API.

Hope this will help you all.

Thanks 🙂

Assigned Tags

      2 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Bilen Cekic
      Bilen Cekic

      do 3 combobox like that and your page will start hang. SAPUI5 is lacking of virtual scrolling on many controls. Only Treeview and UiTable has these features (but very primitive and lack of smoothness). You have same issues with sap.m.table as well, it will kill the performance due to huge number of dom elements, script and styling :/

      Author's profile photo Andrzej Koeller
      Andrzej Koeller

      I always wanted to see a person, who is carefully scrolling 1345 positions in the combobox to find one he wants to select. Reading all the lines he eventually found what he needs at position 763.

      Then, he goes to 2nd combobox to do the same.

       

      Please allow user to access quickly to the information he is trying to use. If there is a huge amount of positions, use search, filters and so on.

      Noone is going to 37 page of google just because search phrase weren't detailed enough. If there is 500 positions to look at, lets make sure user will easily and quickly be able to narrow down and select the one he is looking for.