• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

drop down list box height

 
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I have created one drop down list box in jsp page using struts1.

There is 25 value in drop down list box. I don't want to make list too long. If it make small and then scrollbar will come in list.

could I set the height of list box? any suggestion?

Thanks in advance.
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You cannot set the size of the opened drop-down, only the width of the unopened control.
 
Ranch Hand
Posts: 329
Eclipse IDE Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What I feel is if you have more records in the drop down which doesn’t fit in page then you convince the customer to compromise having it as selection popup (the best way).
however, you can still have dirty work arounds like playing with the visibility settings of div though..
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Shankar Tanikella wrote:however, you can still have dirty work arounds like playing with the visibility settings of div though..



HUH? What are you talking about? How does this apply to a select element?

Eric
 
Shankar Tanikella
Ranch Hand
Posts: 329
Eclipse IDE Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
as i already mentioned dirty.. it is really dirty...

Anyways, what i fell is it is still to do something like below, didn’t try it though

For example, if i have 20 options, i shall iterate till 10 to show the recently used or something but only few in number, for now say 10 and the 11th option would be "...". All this setup would be in a div, and be visible on load on page
when user selects "..."
we shall block this and show another div with all elements (since user asked for it, it would be displayed)...

Doesn't this work?
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It still has nothing at all to do with an HTML select element.

If the <select> element is unsuitable, it's certainly possible to create a custom widget using other HTML elements. In such a case I would not recommend anyone build their own, but rather use one of the existing widgets such as the jQuery UI Autocompleter widget.
 
Shankar Tanikella
Ranch Hand
Posts: 329
Eclipse IDE Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Perfect,
But i still go with a popup with radio button which is easier to implement (if the application is not rich in UI). If UI is rich then yes, to match with other screen elements JQuery is the best one. If Jquery is already in use then also Ok since there would be less learning to do. But only for this one select box? Moreover, its is Struts1 application, rich UI ??
 
Rajni Patel
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am not using jquery. could i set dropdown list box height with java script?

thanks,
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Again, no. Nothing on Earth can change the drop-down height except rewriting the browser itself.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic