• 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
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

html:select able to set the size of display

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
<html:select property="productIds" size="1">
<html ptions collection="quickRecruitProductSelectList" property="value" labelProperty="label" />
</html:select>

I have this drop down select box.
I need to able to add the functionality that it does not expand beyong a certain size.
ie if I have a string of 100 chars, it expands to adjust that string and the whole jsp gets broader.

Is there a way to tel it to stay say 50 cahrs wide and just highlight the info when point it. etc. or any other suggestion to do this.

Thanks
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The good news is that you can control the width of a select box using CSS. For example:

<html:select property="productIds" size="1" style="width:100" >

will produce a select control that is exactly 100 pixels wide, regardless of what the contents of the select box is.

The bad news is that If you do this and one or more of the options is longer that 100 pixels, it will be truncated. The user simply won't be able to see the last part of the option. As far as I know, there's no way around this.
 
AmanSingh SIdhu
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for your help.
It worked, solves my problem.
 
Montana has cold dark nights. Perfect for the heat from incandescent light. Tiny ad:
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
https://coderanch.com/t/751654/free-earth-friendly-heat-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic