You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Slava_L <lo...@esstu.ru> on 2002/04/04 02:51:39 UTC

usage of html:options

we have and ActionForm with Collection field (4xmpl list of smthing)....
how should i use tag html:options to fill parent tag html:select with values of list (from our Collection) 
In uptodate we use this scheme: 
in jsp file we have
<html:from > -> related with ActionForm in struts-config.xml
<bean:define id="locallist" porperty "formlist">
<html:select .....>
<html:options collection="locallist" ...........>
.............

but how can u do the same thin' w/o bean:define ?

Thnx! 


Re: usage of html:options

Posted by Arron Bates <ar...@pacific.net.au>.
The tag Ted mentions is html:optionsCollection, and it's in Struts 1.1

If you have to run 1.0/1.0.1, then what you're doing with the 
bean:define is the standard use. Or, if you have a collection for the 
values, and a value for the labels, then you can just use the 
html:options, with the "property" property pointing at the bean property 
that will yield the value list, and the "labelProperty" pointing at the 
bean property that will be the list of labels. Only thing about this is, 
is that they're separate lists.

But to use the list of beans that themselves hold the label and values, 
then there is no other way but your bean:define usage you already have, 
or the new html:optionsCollection tag.

Arron.


Slava_L wrote:

>Now other suggestions?
>
>----- Original Message -----
>From: "Ted Husted" <hu...@apache.org>
>To: "Struts Users Mailing List" <st...@jakarta.apache.org>
>Sent: Sunday, April 07, 2002 12:40 AM
>Subject: Re: usage of html:options
>
>
>>If the collection is stored on the ActionForm, you have to use
>>bean:define under Struts 1.0.x
>>
>>For Struts 1.1, there is another tag that gets around this.
>>
>>-Ted.
>>
>>
>>Slava_L wrote:
>>
>>>we have and ActionForm with Collection field (4xmpl list of smthing)....
>>>how should i use tag html:options to fill parent tag html:select with
>>>
>values of list (from our Collection)
>
>>>In uptodate we use this scheme:
>>>in jsp file we have
>>><html:from > -> related with ActionForm in struts-config.xml
>>><bean:define id="locallist" porperty "formlist">
>>><html:select .....>
>>><html:options collection="locallist" ...........>
>>>.............
>>>
>>>but how can u do the same thin' w/o bean:define ?
>>>
>>>Thnx!
>>>
>>--
>>To unsubscribe, e-mail:
>>
><ma...@jakarta.apache.org>
>
>>For additional commands, e-mail:
>>
><ma...@jakarta.apache.org>
>
>>
>
>
>--
>To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
>For additional commands, e-mail: <ma...@jakarta.apache.org>
>
>



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: usage of html:options

Posted by Slava_L <lo...@esstu.ru>.
Now other suggestions?

----- Original Message -----
From: "Ted Husted" <hu...@apache.org>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>
Sent: Sunday, April 07, 2002 12:40 AM
Subject: Re: usage of html:options


> If the collection is stored on the ActionForm, you have to use
> bean:define under Struts 1.0.x
>
> For Struts 1.1, there is another tag that gets around this.
>
> -Ted.
>
>
> Slava_L wrote:
> >
> > we have and ActionForm with Collection field (4xmpl list of smthing)....
> > how should i use tag html:options to fill parent tag html:select with
values of list (from our Collection)
> > In uptodate we use this scheme:
> > in jsp file we have
> > <html:from > -> related with ActionForm in struts-config.xml
> > <bean:define id="locallist" porperty "formlist">
> > <html:select .....>
> > <html:options collection="locallist" ...........>
> > .............
> >
> > but how can u do the same thin' w/o bean:define ?
> >
> > Thnx!
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: usage of html:options

Posted by Ted Husted <hu...@apache.org>.
If the collection is stored on the ActionForm, you have to use
bean:define under Struts 1.0.x 

For Struts 1.1, there is another tag that gets around this.

-Ted.


Slava_L wrote:
> 
> we have and ActionForm with Collection field (4xmpl list of smthing)....
> how should i use tag html:options to fill parent tag html:select with values of list (from our Collection)
> In uptodate we use this scheme:
> in jsp file we have
> <html:from > -> related with ActionForm in struts-config.xml
> <bean:define id="locallist" porperty "formlist">
> <html:select .....>
> <html:options collection="locallist" ...........>
> .............
> 
> but how can u do the same thin' w/o bean:define ?
> 
> Thnx!

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>