Skip to Content
0

sap.m.ComboBox only shows 100 items

Jun 10, 2017 at 02:30 PM

185

avatar image

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

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

5 Answers

Sharath M G Jun 11, 2017 at 05:00 AM
0

I faced the same issue. For combo box this issue happened.

I changed the control to Select and that worked. Try that and then set size and bind the model. It should work.

Regards,

Sharath

Show 1 Share
10 |10000 characters needed characters left characters exceeded

Hi Sharath

I have a sap.m.Select also and it's the same issue with it - only the first 100 items are visible in the drop-down even though all 240+ entries are in the result set.

Thanks,
Thomas

0
Jun Wu Jun 11, 2017 at 04:29 AM
0

your ui bind to this._oModel?


Share
10 |10000 characters needed characters left characters exceeded
Akhilesh Upadhyay Jun 11, 2017 at 04:32 AM
0

1) setsizelimit in component.js file after model initialization. or

2) find exact model and set setsizelimit to correct model.

Share
10 |10000 characters needed characters left characters exceeded
Dennis Seah
Jun 11, 2017 at 10:57 PM
0

Hi Thomas

Appears that you are doing the right thing, can it be something else

http://jsbin.com/semawep/edit?html,js,output

thanks

Dennis

Share
10 |10000 characters needed characters left characters exceeded
Thomas Arnesen Jun 12, 2017 at 10:42 AM
0

Thanks for your replies.

I found the culprit.

Later in the code, I set the size limit of the model back to 100 (as I only needed it to be 300 for this particular entity set and combo box). This seems to have affected the combobox when it got populated (even though all 100+ results were in the result set). Once I removed that additional size limit line, all works fine and the combobox displays all expected entries.

this._oModel.setSizeLimit(100);

This line of code was further down in my method so I didn't notice it when including the code in my initial question.

/Thomas

Share
10 |10000 characters needed characters left characters exceeded