File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
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.

I agree. Here's the link:
subject: how to use horizontal_scroll bar to html:select
jQuery in Action, 3rd edition