tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Duffy <duff...@yahoo.com>
Subject RE: Populating One <select> Based On The Value In Another
Date Tue, 06 May 2003 11:58:24 GMT

Exactly.  It's a choice between doing it on the client
side or enduring another round-trip to the server.  I
know how to get it from the server, but I was hoping
that I could send a java.util.Map down when the page
is rendered and save myself a trip.

I agree with what you're suggesting, Wendy.  I know
that works, because I've done that with all the other
pages I have use the same technique.

But this is the first time I've had the problem of
populating one drop-down using the choice from
another.  I know how to get the selection from the
first box out of JavaScript.  Getting that value into
JSTL and the EL is the thing that I'm fuzzy on.


--- Wendy Smoak <Wendy.Smoak@asu.edu> wrote:
> > I've got a JSP with two <select> tags in it.  
> > I populate the first by iterating through a
> > java.util.List using the JSTL <c:forEach> tag.
> > When a user makes a selection from the first
> <select>,
> > I'd like to populate the second <select> option
> list
> > based on that selection.  
> 
> When do you want this to happen?  Unless you use
> JavaScript on the client
> side, you don't really have another chance to affect
> the contents of the
> second drop-down box until the form gets submitted.
> 
> > How do I get the "key" value out of the first
> <select>
> > and into JSTL?  Seems like a common operation. 
> I'd
> > appreciate any advice that anyone could offer. 
> Thanks
> 
> When the form is submitted, the user's choice will
> come through as a request
> parameter, so you can get it with (I haven't done
> this, I use Struts) but I
> think it's ${param.formFieldName}.  I'm looking at
> the example on the second
> page of the JSTL in Action Appendix pdf that's
> available free online.
> 
> -- 
> Wendy Smoak
> Applications Systems Analyst, Sr.
> Arizona State University PA Information Resources
> Management
> 


__________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.
http://search.yahoo.com

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


Mime
View raw message