• 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

scroll bar in <h:selectOneMenu>

 
Ranch Hand
Posts: 43
Eclipse IDE Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Howdy Ranchers,

I tried in vain to bring about scroll bar in <h:selectOneMenu>. But its not showing up.
I am populating values from a DB through <h:selectItems> child tag. Since there are more than 20 values being fetched from the DB, it is causing the dropdown drop 'down' till the end of the page.

If we cant have a scroll bar in selectOneMenu then what is the workaround?

Rangers, please help me out on this.

Ron.
 
Saloon Keeper
Posts: 27762
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You are limited here by the characteristics of the HTML SELECT control, which is in turn defined by the user's browser and OS. A common implementation of this control would put a flat triangle (arrow) at the bottom of the dropdown box for scrolling. Or at the top, as needed. An actual scrollbar is less common.

Speaking as a user, I find any dropdown list with 20 or more elements in it to be awkward, so I recommend meditating on whether this is the optimal way to present your selections.

If you want to ensure an actual scroll bar, you could simply do it the hard way: wrap the list up as a table in a scrollable pop-up div and attach logic/css for highlighting and selection as needed.
 
Vimal Kumar Venugopal
Ranch Hand
Posts: 43
Eclipse IDE Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for your reply Tom.. You surely did hit the nail..!
 
What's gotten into you? Could it be this tiny ad?
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic