• 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

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.
 
It would give a normal human mental abilities to rival mine. To think it is just a tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic