This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Struts and the fly likes how to use horizontal_scroll bar to html:select Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "how to use horizontal_scroll bar to html:select" Watch "how to use horizontal_scroll bar to html:select" New topic

how to use horizontal_scroll bar to html:select

purushotham podaralla

Joined: Sep 12, 2007
Posts: 29
Hi All,

i am using html:select struts tags, and inside i am using html ption, html ptionsCollection....

in html ptionsCollection i am using one collection, while displaying the values from collection by using html ptionsCollection, the size of the html:select is increased, as the value from html ption is very big string, some cases, the values are small strings, so the size of html:select is getting reduced.

<html:select name="xxxxxFB" property="mindIDs" >
< html ptionsCollection property="mindId" labelProperty="mindName"/>

i need to attach one horizontal_scroll bar to html:select, so that if the values of mindId big, i can scroll though the values, but my size of html:select should not change for different values.

please do the needful.
Thanks in advance.

Jerry Mahone

Joined: Jun 19, 2008
Posts: 3
Has anyone else run into this problem? Like the OP, I am having this same problem. Generally, the recommended solution for putting horizontal scroll bars in a straight html <select> element is to surround the select with a <div> and use overflow-x: scroll and overflow:-moz-scrollbars-horizontal. This works great for html's <select> element. However, when I tried this with <html:select> where I am filling the control with <html:optionsCollection> data, I get a horizontal scroll bar alright, but only the arrows and track are displayed. Even though there is definitely data that is wider than the select element, the slider does not appear, so the scrollbar is useless.


ashok chittela

Joined: Dec 09, 2009
Posts: 2
I do have the same problem.I have the code like below in my jsp page

<div style="width:800px;overflow:auto;">
<html:select multiple="true" property="selectedZones" size="10">
<htmlptionsCollection property="zoneList" value="areaCode" label="name"/>

I want both horizontal and vertical bars to get displayed.

Any quick help is really appreciated.

jQuery in Action, 2nd edition
subject: how to use horizontal_scroll bar to html:select
Similar Threads
update html:options
problems in html:select
Can struts repopulate collection from html:select upon submit?
whats problem with following code ** urgent
html:select disabled property not working