Setting length for text displayed with s:select

abuyusuf
abuyusuf used Ask the Experts™
on
We are using a struts select tag displaying several pieces of text in a drop down - we need some way of limiting the width of the text in the select box. Is there anyway to accomplish this ?
Thanks
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Awarded 2011
Awarded 2011

Commented:

I this there is a size attribute which should do it
see here:
http://struts.1045723.n5.nabble.com/Newbie-Q-Rendering-drop-down-menu-td3427495.html

Author

Commented:
Hi - Thanks for the response. The size attribute is part of the s:select struts tag but is used for the number of elements in the drop down and not the width. I need something for the width of strings in the drop down. Thanks
Awarded 2011
Awarded 2011

Commented:
Sorry, I missed the width part, thought you need to limit the list
Awarded 2011
Awarded 2011
Commented:
Wouldn't then width attribute work, like here

        <html:select style="width:180px" size="8" property="strRoleId">
                <html:optionsCollection property="htUserRoles"
label="strDisplayName" value="strId"/>
         </html:select>

from
http://www.mail-archive.com/struts-user@jakarta.apache.org/msg96896.html
Mick BarryJava Developer
Top Expert 2010

Commented:

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial