You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Mark Ayad <ma...@javamark.com> on 2002/11/05 17:01:42 UTC

Dynamic select menu in JSP

I would like to know the best method to populate a form in a JSP page with
dynamic select menu, where the number of options in the select depends on a
query to the database. Specifically where is best to place the functionality
?

<html:select property="singleSelect" size="10">
<html:option value="Single 0">Single 0</html:option>
<html:option value="Single 1">Single 1</html:option>
.......
.......
<html:option value="Single n">Single n</html:option>
.......
</html:select>

Previous to Struts I would have looped aropund a  resultsset.

What do people use ?


Regards

Mark





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


Re: Dynamic select menu in JSP

Posted by John Owen <jo...@hotmail.com>.
Add a Collection to your form bean. Add getter and setter methods to the
form bean. Add code to your action class (usually a prepare-type action) to
look up the data (or call the appropriate facade/delegate method) and
populate the collection on the form. Modify your resultant jsp to use the
Collection in an <html:options> tag within an <html:select> tag. Check the
docs on the struts site for specific details or reply with more specific
questions.
----- Original Message -----
From: "Mark Ayad" <ma...@javamark.com>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>
Sent: Tuesday, November 05, 2002 10:01 AM
Subject: Dynamic select menu in JSP


> I would like to know the best method to populate a form in a JSP page with
> dynamic select menu, where the number of options in the select depends on
a
> query to the database. Specifically where is best to place the
functionality
> ?
>
> <html:select property="singleSelect" size="10">
> <html:option value="Single 0">Single 0</html:option>
> <html:option value="Single 1">Single 1</html:option>
> .......
> .......
> <html:option value="Single n">Single n</html:option>
> .......
> </html:select>
>
> Previous to Struts I would have looped aropund a  resultsset.
>
> What do people use ?
>
>
> Regards
>
> Mark
>
>
>
>
>
> --
> 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: Dynamic select menu in JSP **sigh**

Posted by John Owen <jo...@hotmail.com>.
I don't know what <html:optionsCollection> is, but for your purposes, I
would use <html:options> backed by a Collection as I mentioned earlier.

John
----- Original Message -----
From: "Mark Ayad" <ma...@javamark.com>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>
Sent: Tuesday, November 05, 2002 11:02 AM
Subject: Re: Dynamic select menu in JSP **sigh**


> Not worried.
>
> But something I'm planning for the future should help everyone with API's
> jar versions and examples. A little project I'm dreaming up. I'm sure If
ask
> ask for a show of hand I'll get this project off the ground.
>
> Still I've made progress.
>
> Not sure what's the difference with:
>
> <html:optionsCollection
>
> <html:options
>
> But if I dig I might find out.
>
> ----- Original Message -----
> From: "John Owen" <jo...@hotmail.com>
> To: "Struts Users Mailing List" <st...@jakarta.apache.org>
> Sent: Tuesday, November 05, 2002 5:47 PM
> Subject: Re: Dynamic select menu in JSP
>
>
> > Don't worry, Mark. If there were an adequate example in the Struts docs,
> you
> > would have a better idea how to start and what questions to ask.
However,
> > you have to use this list or scour the internet for examples.
> > ----- Original Message -----
> > From: "Mark Ayad" <ma...@javamark.com>
> > To: "Struts Users Mailing List" <st...@jakarta.apache.org>
> > Sent: Tuesday, November 05, 2002 10:39 AM
> > Subject: Re: Dynamic select menu in JSP
> >
> >
> > > **gasp**
> > >
> > > Sure, but its knowing the right question to ask first .
> > >
> > >
> > >
> > > ----- Original Message -----
> > > From: "Eddie Bush" <ek...@swbell.net>
> > > To: "Struts Users Mailing List" <st...@jakarta.apache.org>
> > > Sent: Tuesday, November 05, 2002 6:27 PM
> > > Subject: Re: Dynamic select menu in JSP
> > >
> > >
> > > > *sigh*
> > > >
> > > > There have been a number of topics going on about doing such things
> > > > lately.  Obviously, using the <html:option> tag is less than ideal.
> > > >  Have you looked at <html:options/> yet?  I think you'll find a much
> > > > better implementation possible using it instead of <html:option/>.
> > > >
> > > > STMA (Search the Mail Archive) - most notably the last 7 days.
You're
> > > > guaranteed to find a message that gives explicit usage instructions.
> A
> > > > hint:  populate the property that represents your options in an
> action.
> > > >  If that doesn't make sense now, it will once you do some research
on
> > > > how to use <html:options/>.  If it doesn't, just let us know.
> > > >
> > > > Mark Ayad wrote:
> > > >
> > > > >I would like to know the best method to populate a form in a JSP
page
> > > with
> > > > >dynamic select menu, where the number of options in the select
> depends
> > on
> > > a
> > > > >query to the database. Specifically where is best to place the
> > > functionality
> > > > >?
> > > > >
> > > > ><html:select property="singleSelect" size="10">
> > > > ><html:option value="Single 0">Single 0</html:option>
> > > > ><html:option value="Single 1">Single 1</html:option>
> > > > >.......
> > > > >.......
> > > > ><html:option value="Single n">Single n</html:option>
> > > > >.......
> > > > ></html:select>
> > > > >
> > > > >Previous to Struts I would have looped aropund a  resultsset.
> > > > >
> > > > >What do people use ?
> > > > >
> > > > >
> > > > >Regards
> > > > >
> > > > >Mark
> > > > >
> > > >
> > > > --
> > > > Eddie Bush
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > --
> > > > 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>
> >
> >
>
>
> --
> 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: Dynamic select menu in JSP **sigh**

Posted by Mark Ayad <ma...@javamark.com>.
Not worried.

But something I'm planning for the future should help everyone with API's
jar versions and examples. A little project I'm dreaming up. I'm sure If ask
ask for a show of hand I'll get this project off the ground.

Still I've made progress.

Not sure what's the difference with:

<html:optionsCollection

<html:options

But if I dig I might find out.

----- Original Message -----
From: "John Owen" <jo...@hotmail.com>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>
Sent: Tuesday, November 05, 2002 5:47 PM
Subject: Re: Dynamic select menu in JSP


> Don't worry, Mark. If there were an adequate example in the Struts docs,
you
> would have a better idea how to start and what questions to ask. However,
> you have to use this list or scour the internet for examples.
> ----- Original Message -----
> From: "Mark Ayad" <ma...@javamark.com>
> To: "Struts Users Mailing List" <st...@jakarta.apache.org>
> Sent: Tuesday, November 05, 2002 10:39 AM
> Subject: Re: Dynamic select menu in JSP
>
>
> > **gasp**
> >
> > Sure, but its knowing the right question to ask first .
> >
> >
> >
> > ----- Original Message -----
> > From: "Eddie Bush" <ek...@swbell.net>
> > To: "Struts Users Mailing List" <st...@jakarta.apache.org>
> > Sent: Tuesday, November 05, 2002 6:27 PM
> > Subject: Re: Dynamic select menu in JSP
> >
> >
> > > *sigh*
> > >
> > > There have been a number of topics going on about doing such things
> > > lately.  Obviously, using the <html:option> tag is less than ideal.
> > >  Have you looked at <html:options/> yet?  I think you'll find a much
> > > better implementation possible using it instead of <html:option/>.
> > >
> > > STMA (Search the Mail Archive) - most notably the last 7 days.  You're
> > > guaranteed to find a message that gives explicit usage instructions.
A
> > > hint:  populate the property that represents your options in an
action.
> > >  If that doesn't make sense now, it will once you do some research on
> > > how to use <html:options/>.  If it doesn't, just let us know.
> > >
> > > Mark Ayad wrote:
> > >
> > > >I would like to know the best method to populate a form in a JSP page
> > with
> > > >dynamic select menu, where the number of options in the select
depends
> on
> > a
> > > >query to the database. Specifically where is best to place the
> > functionality
> > > >?
> > > >
> > > ><html:select property="singleSelect" size="10">
> > > ><html:option value="Single 0">Single 0</html:option>
> > > ><html:option value="Single 1">Single 1</html:option>
> > > >.......
> > > >.......
> > > ><html:option value="Single n">Single n</html:option>
> > > >.......
> > > ></html:select>
> > > >
> > > >Previous to Struts I would have looped aropund a  resultsset.
> > > >
> > > >What do people use ?
> > > >
> > > >
> > > >Regards
> > > >
> > > >Mark
> > > >
> > >
> > > --
> > > Eddie Bush
> > >
> > >
> > >
> > >
> > >
> > > --
> > > 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>
>
>


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


Re: Dynamic select menu in JSP

Posted by John Owen <jo...@hotmail.com>.
Don't worry, Mark. If there were an adequate example in the Struts docs, you
would have a better idea how to start and what questions to ask. However,
you have to use this list or scour the internet for examples.
----- Original Message -----
From: "Mark Ayad" <ma...@javamark.com>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>
Sent: Tuesday, November 05, 2002 10:39 AM
Subject: Re: Dynamic select menu in JSP


> **gasp**
>
> Sure, but its knowing the right question to ask first .
>
>
>
> ----- Original Message -----
> From: "Eddie Bush" <ek...@swbell.net>
> To: "Struts Users Mailing List" <st...@jakarta.apache.org>
> Sent: Tuesday, November 05, 2002 6:27 PM
> Subject: Re: Dynamic select menu in JSP
>
>
> > *sigh*
> >
> > There have been a number of topics going on about doing such things
> > lately.  Obviously, using the <html:option> tag is less than ideal.
> >  Have you looked at <html:options/> yet?  I think you'll find a much
> > better implementation possible using it instead of <html:option/>.
> >
> > STMA (Search the Mail Archive) - most notably the last 7 days.  You're
> > guaranteed to find a message that gives explicit usage instructions.  A
> > hint:  populate the property that represents your options in an action.
> >  If that doesn't make sense now, it will once you do some research on
> > how to use <html:options/>.  If it doesn't, just let us know.
> >
> > Mark Ayad wrote:
> >
> > >I would like to know the best method to populate a form in a JSP page
> with
> > >dynamic select menu, where the number of options in the select depends
on
> a
> > >query to the database. Specifically where is best to place the
> functionality
> > >?
> > >
> > ><html:select property="singleSelect" size="10">
> > ><html:option value="Single 0">Single 0</html:option>
> > ><html:option value="Single 1">Single 1</html:option>
> > >.......
> > >.......
> > ><html:option value="Single n">Single n</html:option>
> > >.......
> > ></html:select>
> > >
> > >Previous to Struts I would have looped aropund a  resultsset.
> > >
> > >What do people use ?
> > >
> > >
> > >Regards
> > >
> > >Mark
> > >
> >
> > --
> > Eddie Bush
> >
> >
> >
> >
> >
> > --
> > 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: Dynamic select menu in JSP

Posted by Mark Ayad <ma...@javamark.com>.
Eddie Don't do my research um - I got a PhD in Molecular Physics and
Nanotechnology for doing some very good research. Oh and then there was Bell
Labs.

Oh never used Google whats that ?

With 52,000 mails and a very poor interface, a.k.a you can't even order by
date ?
I'll know not to post so fast in future for fear of being made an example of
by Eddie.

However if the framework is so simple why is there 52,000 mail comparable
with Tomcat ?


----- Original Message -----
From: "Eddie Bush" <ek...@swbell.net>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>
Sent: Wednesday, November 06, 2002 12:42 AM
Subject: Re: Dynamic select menu in JSP


> Try "Struts html:option" - works super.  I actually did try it :-)  I
> didn't get as good of a return as I expected though :-/  I'm sure I
> could refine it better and get a better return, but, as I was just doing
> it to ensure I was getting back relevant data, I didn't investigate it
> thoroughly.
>
> The point is valid though :-) Far too few people actually take the time
> to do any research on their question before asking.  Chances are, if you
> have a problem, someone has already run into it and likely solved it as
> well.  The first thing I do when I hit a "rough spot" is look around -
> Google is my first stop.  I'll try a few (anywhere from 3-5) different
> permutations of relevant keywords (doing things such as removing that
> troublesome colon) and see what I get.  Most of the time that's ...
> plenty :-)  There are times it does not suffice.
>
> John Owen wrote:
>
> >When you put "html:option" in the search box it doesn't work. At least,
it
> >never has for me. The ':' screws it up and searching on "option" or "html
> >option" is not viable. I'm going to reiterate that if the Struts docs had
> >good examples of implementation, a lot of repetitive questions could be
> >avoided. I would gladly update the documentation if I had the time.
> >
> >John
> >
>
> --
> Eddie Bush
>
>
>
>
>
> --
> 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: Dynamic select menu in JSP

Posted by "V. Cekvenich" <vi...@users.sourceforge.net>.
Regarding menus, I use struts - menu from sourceforge.
You can see struts menu runing at baseBeans.com live.
.V

John Owen wrote:
> I just tried "Struts html:option","Struts html:options","html:options" and
> "html:option" in the mail archive for struts-user and neither search
> returned results.
> 
> John
> ----- Original Message -----
> From: "Eddie Bush" <ek...@swbell.net>
> To: "Struts Users Mailing List" <st...@jakarta.apache.org>
> Sent: Tuesday, November 05, 2002 5:42 PM
> Subject: Re: Dynamic select menu in JSP
> 
> 
> 
>>Try "Struts html:option" - works super.  I actually did try it :-)  I
>>didn't get as good of a return as I expected though :-/  I'm sure I
>>could refine it better and get a better return, but, as I was just doing
>>it to ensure I was getting back relevant data, I didn't investigate it
>>thoroughly.
>>
>>The point is valid though :-) Far too few people actually take the time
>>to do any research on their question before asking.  Chances are, if you
>>have a problem, someone has already run into it and likely solved it as
>>well.  The first thing I do when I hit a "rough spot" is look around -
>>Google is my first stop.  I'll try a few (anywhere from 3-5) different
>>permutations of relevant keywords (doing things such as removing that
>>troublesome colon) and see what I get.  Most of the time that's ...
>>plenty :-)  There are times it does not suffice.
>>
>>John Owen wrote:
>>
>>
>>>When you put "html:option" in the search box it doesn't work. At least,
>>
> it
> 
>>>never has for me. The ':' screws it up and searching on "option" or "html
>>>option" is not viable. I'm going to reiterate that if the Struts docs had
>>>good examples of implementation, a lot of repetitive questions could be
>>>avoided. I would gladly update the documentation if I had the time.
>>>
>>>John
>>>
>>
>>--
>>Eddie Bush
>>
>>
>>
>>
>>
>>--
>>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: Dynamic select menu in JSP

Posted by John Owen <jo...@hotmail.com>.
I just tried "Struts html:option","Struts html:options","html:options" and
"html:option" in the mail archive for struts-user and neither search
returned results.

John
----- Original Message -----
From: "Eddie Bush" <ek...@swbell.net>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>
Sent: Tuesday, November 05, 2002 5:42 PM
Subject: Re: Dynamic select menu in JSP


> Try "Struts html:option" - works super.  I actually did try it :-)  I
> didn't get as good of a return as I expected though :-/  I'm sure I
> could refine it better and get a better return, but, as I was just doing
> it to ensure I was getting back relevant data, I didn't investigate it
> thoroughly.
>
> The point is valid though :-) Far too few people actually take the time
> to do any research on their question before asking.  Chances are, if you
> have a problem, someone has already run into it and likely solved it as
> well.  The first thing I do when I hit a "rough spot" is look around -
> Google is my first stop.  I'll try a few (anywhere from 3-5) different
> permutations of relevant keywords (doing things such as removing that
> troublesome colon) and see what I get.  Most of the time that's ...
> plenty :-)  There are times it does not suffice.
>
> John Owen wrote:
>
> >When you put "html:option" in the search box it doesn't work. At least,
it
> >never has for me. The ':' screws it up and searching on "option" or "html
> >option" is not viable. I'm going to reiterate that if the Struts docs had
> >good examples of implementation, a lot of repetitive questions could be
> >avoided. I would gladly update the documentation if I had the time.
> >
> >John
> >
>
> --
> Eddie Bush
>
>
>
>
>
> --
> 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: Dynamic select menu in JSP

Posted by "V. Cekvenich" <vi...@users.sourceforge.net>.
Thanks. I did not even think of that.
.V

Eddie Bush wrote:
> Try "Struts html:option" - works super.  I actually did try it :-)  I 
> didn't get as good of a return as I expected though :-/  I'm sure I 
> could refine it better and get a better return, but, as I was just doing 
> it to ensure I was getting back relevant data, I didn't investigate it 
> thoroughly.
> 
> The point is valid though :-) Far too few people actually take the time 
> to do any research on their question before asking.  Chances are, if you 
> have a problem, someone has already run into it and likely solved it as 
> well.  The first thing I do when I hit a "rough spot" is look around - 
> Google is my first stop.  I'll try a few (anywhere from 3-5) different 
> permutations of relevant keywords (doing things such as removing that 
> troublesome colon) and see what I get.  Most of the time that's ... 
> plenty :-)  There are times it does not suffice.
> 
> John Owen wrote:
> 
>> When you put "html:option" in the search box it doesn't work. At 
>> least, it
>> never has for me. The ':' screws it up and searching on "option" or "html
>> option" is not viable. I'm going to reiterate that if the Struts docs had
>> good examples of implementation, a lot of repetitive questions could be
>> avoided. I would gladly update the documentation if I had the time.
>>
>> John
>>
> 




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


Re: Dynamic select menu in JSP

Posted by Eddie Bush <ek...@swbell.net>.
Try "Struts html:option" - works super.  I actually did try it :-)  I 
didn't get as good of a return as I expected though :-/  I'm sure I 
could refine it better and get a better return, but, as I was just doing 
it to ensure I was getting back relevant data, I didn't investigate it 
thoroughly.

The point is valid though :-) Far too few people actually take the time 
to do any research on their question before asking.  Chances are, if you 
have a problem, someone has already run into it and likely solved it as 
well.  The first thing I do when I hit a "rough spot" is look around - 
Google is my first stop.  I'll try a few (anywhere from 3-5) different 
permutations of relevant keywords (doing things such as removing that 
troublesome colon) and see what I get.  Most of the time that's ... 
plenty :-)  There are times it does not suffice.

John Owen wrote:

>When you put "html:option" in the search box it doesn't work. At least, it
>never has for me. The ':' screws it up and searching on "option" or "html
>option" is not viable. I'm going to reiterate that if the Struts docs had
>good examples of implementation, a lot of repetitive questions could be
>avoided. I would gladly update the documentation if I had the time.
>
>John
>

-- 
Eddie Bush





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


Re: Dynamic select menu in JSP

Posted by John Owen <jo...@hotmail.com>.
When you put "html:option" in the search box it doesn't work. At least, it
never has for me. The ':' screws it up and searching on "option" or "html
option" is not viable. I'm going to reiterate that if the Struts docs had
good examples of implementation, a lot of repetitive questions could be
avoided. I would gladly update the documentation if I had the time.

John
----- Original Message -----
From: "Eddie Bush" <ek...@swbell.net>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>
Sent: Tuesday, November 05, 2002 4:59 PM
Subject: Re: Dynamic select menu in JSP


> That's a very valid point.  Did you, in the course of asking to be put
> on the list, actually read:
>
> http://www.tuxedo.org/~esr/faqs/smart-questions.html
>
> ... or just look for the link that said "sign me up!" ? :-)  Not trying
> to be difficult - I'm just honestly curious ;-)  I would be willing to
> wager (and I'm not a betting man) that if you searched for html:option
> you'd find several suggestions to "use html:options instead" - and some
> of even those likely have explicit details as well :-)
>
> I'm not in the habit of holding grudges, so don't feel *too bad*.
>  You're far from the first to ask a repetitive question, and I doubt
> you'll be the last.  It would be nice if folks exercised their
> STFW-related brain cells though :-)
>
> (Sorry - not trying to single you out - this particular question is
> occassionally asked and answered as many as three times in a single day
> though - I can't remember the last week that passed without at least a
> single query on it.)
>
> Peace ;-)
>
> Mark Ayad wrote:
>
> >**gasp**
> >
> >Sure, but its knowing the right question to ask first .
> >
>
> --
> Eddie Bush
>
>
>
>
> --
> 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: Dynamic select menu in JSP

Posted by Eddie Bush <ek...@swbell.net>.
That's a very valid point.  Did you, in the course of asking to be put 
on the list, actually read:

http://www.tuxedo.org/~esr/faqs/smart-questions.html

... or just look for the link that said "sign me up!" ? :-)  Not trying 
to be difficult - I'm just honestly curious ;-)  I would be willing to 
wager (and I'm not a betting man) that if you searched for html:option 
you'd find several suggestions to "use html:options instead" - and some 
of even those likely have explicit details as well :-)

I'm not in the habit of holding grudges, so don't feel *too bad*. 
 You're far from the first to ask a repetitive question, and I doubt 
you'll be the last.  It would be nice if folks exercised their 
STFW-related brain cells though :-)

(Sorry - not trying to single you out - this particular question is 
occassionally asked and answered as many as three times in a single day 
though - I can't remember the last week that passed without at least a 
single query on it.)

Peace ;-)

Mark Ayad wrote:

>**gasp**
>
>Sure, but its knowing the right question to ask first .
>

-- 
Eddie Bush




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


Re: Dynamic select menu in JSP

Posted by Mark Ayad <ma...@javamark.com>.
**gasp**

Sure, but its knowing the right question to ask first .



----- Original Message -----
From: "Eddie Bush" <ek...@swbell.net>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>
Sent: Tuesday, November 05, 2002 6:27 PM
Subject: Re: Dynamic select menu in JSP


> *sigh*
>
> There have been a number of topics going on about doing such things
> lately.  Obviously, using the <html:option> tag is less than ideal.
>  Have you looked at <html:options/> yet?  I think you'll find a much
> better implementation possible using it instead of <html:option/>.
>
> STMA (Search the Mail Archive) - most notably the last 7 days.  You're
> guaranteed to find a message that gives explicit usage instructions.  A
> hint:  populate the property that represents your options in an action.
>  If that doesn't make sense now, it will once you do some research on
> how to use <html:options/>.  If it doesn't, just let us know.
>
> Mark Ayad wrote:
>
> >I would like to know the best method to populate a form in a JSP page
with
> >dynamic select menu, where the number of options in the select depends on
a
> >query to the database. Specifically where is best to place the
functionality
> >?
> >
> ><html:select property="singleSelect" size="10">
> ><html:option value="Single 0">Single 0</html:option>
> ><html:option value="Single 1">Single 1</html:option>
> >.......
> >.......
> ><html:option value="Single n">Single n</html:option>
> >.......
> ></html:select>
> >
> >Previous to Struts I would have looped aropund a  resultsset.
> >
> >What do people use ?
> >
> >
> >Regards
> >
> >Mark
> >
>
> --
> Eddie Bush
>
>
>
>
>
> --
> 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: Dynamic select menu in JSP

Posted by Eddie Bush <ek...@swbell.net>.
*sigh*

There have been a number of topics going on about doing such things 
lately.  Obviously, using the <html:option> tag is less than ideal. 
 Have you looked at <html:options/> yet?  I think you'll find a much 
better implementation possible using it instead of <html:option/>.

STMA (Search the Mail Archive) - most notably the last 7 days.  You're 
guaranteed to find a message that gives explicit usage instructions.  A 
hint:  populate the property that represents your options in an action. 
 If that doesn't make sense now, it will once you do some research on 
how to use <html:options/>.  If it doesn't, just let us know.

Mark Ayad wrote:

>I would like to know the best method to populate a form in a JSP page with
>dynamic select menu, where the number of options in the select depends on a
>query to the database. Specifically where is best to place the functionality
>?
>
><html:select property="singleSelect" size="10">
><html:option value="Single 0">Single 0</html:option>
><html:option value="Single 1">Single 1</html:option>
>.......
>.......
><html:option value="Single n">Single n</html:option>
>.......
></html:select>
>
>Previous to Struts I would have looped aropund a  resultsset.
>
>What do people use ?
>
>
>Regards
>
>Mark
>

-- 
Eddie Bush





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


Re: Dynamic select menu in JSP

Posted by Mark Ayad <ma...@javamark.com>.
Thanks John

----- Original Message -----
From: "John Owen" <jo...@hotmail.com>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>
Sent: Tuesday, November 05, 2002 5:06 PM
Subject: Re: Dynamic select menu in JSP


> Here's an example of the jsp code :
>
>       <html:select property="defaultEmployee">
>         <html:options property="employeeValues"
> labelProperty="employeeLabels"/>
>       </html:select>
>
> defaultEmployee is a String representing the 'selected' value,
> employeeValues is a Collection that contains the values for each option,
> employeeLabels is a Collection that contains the labels displayed in the
> drop-down. These variables are all defined in the form bean used by the
jsp
> defined in the action mapping in your struts-config.xml. The Collections
are
> populated in an action class that is used to prepare the form before the
> user sees the jsp page.
>
> John
> ----- Original Message -----
> From: "Mark Ayad" <ma...@javamark.com>
> To: "Struts Users Mailing List" <st...@jakarta.apache.org>
> Sent: Tuesday, November 05, 2002 10:01 AM
> Subject: Dynamic select menu in JSP
>
>
> > I would like to know the best method to populate a form in a JSP page
with
> > dynamic select menu, where the number of options in the select depends
on
> a
> > query to the database. Specifically where is best to place the
> functionality
> > ?
> >
> > <html:select property="singleSelect" size="10">
> > <html:option value="Single 0">Single 0</html:option>
> > <html:option value="Single 1">Single 1</html:option>
> > .......
> > .......
> > <html:option value="Single n">Single n</html:option>
> > .......
> > </html:select>
> >
> > Previous to Struts I would have looped aropund a  resultsset.
> >
> > What do people use ?
> >
> >
> > Regards
> >
> > Mark
> >
> >
> >
> >
> >
> > --
> > 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: Dynamic select menu in JSP

Posted by John Owen <jo...@hotmail.com>.
Here's an example of the jsp code :

      <html:select property="defaultEmployee">
        <html:options property="employeeValues"
labelProperty="employeeLabels"/>
      </html:select>

defaultEmployee is a String representing the 'selected' value,
employeeValues is a Collection that contains the values for each option,
employeeLabels is a Collection that contains the labels displayed in the
drop-down. These variables are all defined in the form bean used by the jsp
defined in the action mapping in your struts-config.xml. The Collections are
populated in an action class that is used to prepare the form before the
user sees the jsp page.

John
----- Original Message -----
From: "Mark Ayad" <ma...@javamark.com>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>
Sent: Tuesday, November 05, 2002 10:01 AM
Subject: Dynamic select menu in JSP


> I would like to know the best method to populate a form in a JSP page with
> dynamic select menu, where the number of options in the select depends on
a
> query to the database. Specifically where is best to place the
functionality
> ?
>
> <html:select property="singleSelect" size="10">
> <html:option value="Single 0">Single 0</html:option>
> <html:option value="Single 1">Single 1</html:option>
> .......
> .......
> <html:option value="Single n">Single n</html:option>
> .......
> </html:select>
>
> Previous to Struts I would have looped aropund a  resultsset.
>
> What do people use ?
>
>
> Regards
>
> Mark
>
>
>
>
>
> --
> 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>