Lengthening the select-components drop down list

Is there a simple way of lengthening the select-components drop down list?

When I extend the Select-class and override the pageLength-variable with 20 (default 10) it makes the drop down list longer but there’s couple of problems left.

Firstly, if there is more results than 10 (the default value), the drop down list draws the arrows even thought the results (15 for example) fits to one “page”. And the lower part shows the “1-15/15”-text. That text and arrows aren’t needed in this case. And the with 10 or less lines in the list, those arrows and the text aren’t shown.

Secondly, when there’s more than 20 lines, and you move to next drop down list “page”, the text says “11-17/27”. When it should be “21-27/27”.

And how hard would it be to make the drop down list work with a scroll bar instead of arrow-buttons?

With a quick glance to Select and AbstractSelect I didn’t see how you could easily fix these problems, so I’m asking for a hint how to do it.

The problem with the pagelength is, that it is also fixed on the client-side GWT code, see VFilterSelect.java. But be careful, some very nasty code ahead.

The ComboBox/FilterSelect is in need of a total refactoring. And you’re absolutely right about the arrow buttons, they should be replaced by a scrollbar and mouse scrollwheel (this has been acknowledged a long time ago, no-one has had the time to refactor it, since it is quite a beast).

I think a proper enhancement/defect ticket about these issues might help in getting it fixed :wink:

Hi,

As Jouni noted, this is also hard-coded client-side at the moment. I have some good news, however: it’s trivial to change - I’ll see if we can fit it into 6.0…
(In the mean time: changing the VFilterSelect PAGELENTH integer to match your updated Select pageLength will do the trick.)

Best Regards,
Marc

Ok, thanks for the tip. But I guess I’ll just wait untill you fix it :slight_smile:

I just used CSS to get rid of the text and the disabled next- and prev -buttons. Thats perfectly fine solution for me at this point. I don’t really need the info about the amount of items in my select-component.


http://dev.vaadin.com/ticket/3019