Important Notice - Forums is archived
To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.
ComboBox: increase number of shown items
Hi,
is there a way to increase the number of shown items in the ComboBox component?
Details
The default value seems to be 10 items. If there are more entries in the underlying data model I have to use the arrow elements for scrolling. Now I would like to display more items at once. Do I have to modify the data model or the style?
Thanks, Thorsten
Hi,
The Select class (ComboBox inherits from) contains a protected pageLenght field, which defines the number of items per page. Unfortunately, there is no setter for this variable, so you have extend ComboBox to modify the field:
public class MyComboBox extends ComboBox {
public MyComboBox() {
pageLength = 20;
}
}
-Henri
If I remember correctly, the value is hardcoded into both ComboBox and VFilterSelect classes (constants), and they should be overridable by extending the classes.
This should really be on the API level, IMO. There might be a ticket about in our Trac. At least there should be, so please create one if you feel it's important.
Edit: blimey, Henri beat me to it :)