Hi Ken,

I have a Struts white paper, with an example of this.
It also has lots of other examples as well.  You can 
get it at: http://stealthis.athensgroup.com/presentations/
under Model Layer Framework.

Basically you set up both lists in the Action Class and
put them into the session or request (depends on how you
set this action up in struts-config.xml).  When the user
selects an item in the first list it submits the form, and
in your action you retrieve the variable from the form that
gets set.  This allows you to redo the second list to match
the first list, and then you put the new list back into the
session (or request) and go back to your jsp to redisplay
the new list.

-- Larry


-----Original Message-----
From: Struts Newsgroup [mailto:@[EMAIL PROTECTED]]
Sent: Thursday, March 28, 2002 12:55 PM
To: [EMAIL PROTECTED]
Subject: Re: Multiple Selects in a JSP


Subject: Re: Multiple Selects in a JSP
From: "Ken Holzer" <[EMAIL PROTECTED]>
 ===
Hi Larry,

Do you have a sample app demoing this concept? I am not sure how the Action
Form, Action Class and JSP should be setup.

Are the lists built in the Action Form or the Action Class?

Thanks for your help,

Ken
"Maturo, Larry" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]...
> Hi Ken,
>
> Yes, but by using a small amount of JavaScript:
>
> <html:select property="orgId" onchange='document.forms[0].submit()'>
> html:options collection="orgList" property="value"
> labelProperty="shortName"/>
> </html:select>
>
> You should 0 out the string field orgId in your form bean so that you
> can tell a selection was made comparing it to 0.
>
> -- Larry Maturo
>    [EMAIL PROTECTED]
>
> -----Original Message-----
> From: Struts Newsgroup [mailto:@[EMAIL PROTECTED]]
> Sent: Tuesday, March 26, 2002 4:25 PM
> To: [EMAIL PROTECTED]
> Subject: Multiple Selects in a JSP
>
>
> Subject: Multiple Selects in a JSP
> From: "Ken Holzer" <[EMAIL PROTECTED]>
>  ===
> I have two selects in my JSP and I want to be able to dynamically change
the
> options of the 2nd select based on the choice selected from the 1st
select.
>
> Is there a way to do that using the Struts tags?
>
> Thanks,
>
> Ken
>
>
>
> --
> To unsubscribe, e-mail:
> <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
> <mailto:[EMAIL PROTECTED]>
>
>
> --
> To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>
>



--
To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to