cancel
Showing results for 
Search instead for 
Did you mean: 

sap.m.ComboBox only shows 100 items

thomas_arnesen
Explorer
6,951

Hi there

I've a ComboBox that will only display 100 items. Below is my code in the controller, populating the ComboBox, but only with the first 100 items:

var oNatio = oView.byId("selPersEditNatio");
var oNatioItemSelectTemplate = new sap.ui.core.Item({
	key: "{Land1}",
	text: "{NatioText}"
});
this._oModel.setSizeLimit(300);
oNatio.bindItems({
	path: "/CountrySet",
	template: oNatioItemSelectTemplate
});

When fetching the result set, all entries are returned - this is the request from the browser:

CountrySet?$skip=0&$top=300

When checking the result of this request, all entries are in the response.

But still, only the first 100 are shown in the combo box. Any idea why that is?

Thanks in advance;
Thomas

View Entire Topic

In case you guys still looking for a solution for above issue.

Solution to set length in UI and in Controller

Pass length while binding the items for comboBox.

<ComboBox items="{path : 'DeliveryTimeSetModel>/',length : '500'}" id="dis_time" selectedKey="{soc_cart>DELIVERYTIME}" width="150px">

<sap.ui.core:Item text="{DeliveryTimeSetModel>Deliverytimedesc}" key="{DeliveryTimeSetModel>Deliverytime}"></sap.ui.core:Item>

</ComboBox>

Or if you want to set later in Controller

var Combobox = oView.byId("dis_time");
var oComboboxSelectTemplate =new sap.ui.core.Item({key:"{DeliveryTimeSetModel>Deliverytimedesc}",text:"{DeliveryTimeSetModel>Deliverytime}"});
oNatio.bindItems({
path:"DeliveryTimeSetModel>/",
template: oComboboxSelectTemplate,
length: 500
});