You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Andy <an...@fritter.net> on 2005/06/02 18:57:25 UTC

Newbie Q - Rendering drop down menu

Hi All,

Why does the following render as a box containing text (you know what I
mean - where you can select multiple items) rather than a drop down menu ?

 <bean:define id="countryList" property="countryList" name="SearchForm"/>
     <html:select size="10" property="countryList">
     <html:options collection="countryList" labelProperty="displayName"
property="id"/>
            </html:select>

I mean how else can you define select and options? *confused*

Andy.



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Newbie Q - Rendering drop down menu

Posted by Dave Newton <ne...@pingsite.com>.
Andy wrote:

>Why does the following render as a box containing text (you know what I
>mean - where you can select multiple items) rather than a drop down menu ?
>
> <bean:define id="countryList" property="countryList" name="SearchForm"/>
>     <html:select size="10" property="countryList">
>     <html:options collection="countryList" labelProperty="displayName"
>property="id"/>
>            </html:select>
>  
>
Because you set the size: 
http://struts.apache.org/userGuide/struts-html.html#select

Dave



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Newbie Q - Rendering drop down menu

Posted by Riyaz Mansoor <rm...@gmail.com>.
:) when i first read HTML, my first impression was SELECT.size was the 
same INPUT.size hehe. ie it renders a box/select which contains that 
many approximate characters

IMHO, honestly, i think its a bad choice of attribute name. "rows" as in 
TEXTAREA.rows would have been more appropriate than "size". in fact, 
what's the way to set the width of a SELECT box in HTML, not using CSS ?

riyaz


Jeff Beal wrote:

> In other words, the size attribute that you are using *tells* the
> browser to show up to ten rows from the selection list at once.  What
> did you think it was for, out of curiosity?

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


RE: Newbie Q - Rendering drop down menu

Posted by Andy <an...@fritter.net>.
Thanks all, that was indeed the problem.

>-----Original Message-----
>From: Jeff Beal [mailto:jbbeal@gmail.com]
>Sent: 02 June 2005 18:01
>To: Struts Users Mailing List
>Subject: Re: Newbie Q - Rendering drop down menu
>
>
>>>From http://www.w3.org/TR/html401/interact/forms.html#h-17.6:
>
>"size = number [CN]
>    If a SELECT element is presented as a scrolled list box, this
>attribute specifies the number of rows in the list that should be
>visible at the same time. Visual user agents are not required to
>present a SELECT element as a list box; they may use any other
>mechanism, such as a drop-down menu."
>
>In other words, the size attribute that you are using *tells* the
>browser to show up to ten rows from the selection list at once.  What
>did you think it was for, out of curiosity?
>
>-- Jeff
>
>On 6/2/05, Andy <an...@fritter.net> wrote:
>>
>> Hi All,
>>
>> Why does the following render as a box containing text (you know what I
>> mean - where you can select multiple items) rather than a drop
>down menu ?
>>
>>  <bean:define id="countryList" property="countryList" name="SearchForm"/>
>>      <html:select size="10" property="countryList">
>>      <html:options collection="countryList" labelProperty="displayName"
>> property="id"/>
>>             </html:select>
>>
>> I mean how else can you define select and options? *confused*
>>
>> Andy.
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>For additional commands, e-mail: user-help@struts.apache.org
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Newbie Q - Rendering drop down menu

Posted by Jeff Beal <jb...@gmail.com>.
>From http://www.w3.org/TR/html401/interact/forms.html#h-17.6:

"size = number [CN]
    If a SELECT element is presented as a scrolled list box, this
attribute specifies the number of rows in the list that should be
visible at the same time. Visual user agents are not required to
present a SELECT element as a list box; they may use any other
mechanism, such as a drop-down menu."

In other words, the size attribute that you are using *tells* the
browser to show up to ten rows from the selection list at once.  What
did you think it was for, out of curiosity?

-- Jeff

On 6/2/05, Andy <an...@fritter.net> wrote:
> 
> Hi All,
> 
> Why does the following render as a box containing text (you know what I
> mean - where you can select multiple items) rather than a drop down menu ?
> 
>  <bean:define id="countryList" property="countryList" name="SearchForm"/>
>      <html:select size="10" property="countryList">
>      <html:options collection="countryList" labelProperty="displayName"
> property="id"/>
>             </html:select>
> 
> I mean how else can you define select and options? *confused*
> 
> Andy.
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Newbie Q - Rendering drop down menu

Posted by Brian Bezanson <br...@gmail.com>.
> Why does the following render as a box containing text (you know what I
> mean - where you can select multiple items) rather than a drop down menu ?
> 
>  <bean:define id="countryList" property="countryList" name="SearchForm"/>
>      <html:select size="10" property="countryList">
>      <html:options collection="countryList" labelProperty="displayName"
> property="id"/>
>             </html:select>

You gave it a size of 10 so it makes a scrolling list with a size of
10 versus a drop-down menu (size would be '1').

To enable multiple selection, add into the html:select tag
'multiple"anything"', to disable remove or set 'multiple=""'.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org