> -----Original Message-----
> From: Andrew Close [mailto:[EMAIL PROTECTED]
> Sent: Thursday, July 15, 2004 1:08 PM
> To: Struts Users Mailing List
> Subject: Re: <html:select><html:optionsCollection>
> 
> 
> On Thu, 15 Jul 2004 12:10:49 -0700, Jim Barrows 
> <[EMAIL PROTECTED]> wrote:
> 
> > Just to make sure I understand what's happening.....
> > You display a page, user selects from first list, the page 
> submits, the action does it's thing,  and populates the 
> second list, then the user selects from that list, submits 
> and at that point you only have the first selection and not 
> the second.  In addition the javascript seems to know what's 
> going on, but the form bean doesn't.
> 
> close. :)  i display a page with two dropdowns.  the first one is
> populated.  after selecting a value from the first dropdown my action
> should get that dropdowns value out of the form and use that value to
> get the contents of the other dropdown and then return to the same
> JSP.
> the javascript that i'm using to submit the form checks to make sure
> the dropdown value isn't = -1.  then it submits the form.  i've added
> an alert to the javascript and am able to see the value of the
> dropdown there.
> however, in the action when i try to get the dropdowns value out of
> the form i only get -1, the initial value.
> the form is able to get textfield values from the JSP, but not the
> select values...
> 
> > 
> > I would try a dummy action that would fill both lists, then 
> select from both lists and get that working, then I would try 
> doing it your way.  I have a sneaking suspicion that there is 
> something funky going on with the javascript, but don't know 
> what it would be.  Eliminating it and getting the basic 
> operations working first would be a good start.
> > 
> 
> the second dropdown relies on the selected value of the first
> dropdown.  using the javascript to submit the form was the only option
> i could think of since i could use the onchange event to resubmit the
> form.  is there a better way to to that?  i really don't think the
> javascript is causing the problem since i'm able to display both the
> value of the dropdown and textfield in alert boxes when submitting. 
> but for some reason the form or action doesn't pick up the selected
> value of the dropdown...

I don't think there is a better way, I'm just suggesting maybe hardcoding those to 
drop downs for testing purposes, and eliminate the JS.  You're JSP looks right, and 
I'm assuming that your form bean has the return values as arrays if their 
multi-select, or single strings and they're otherwise set up exactly the same.
Technically you're submitting the same form twice, so it should be working.  I'm 
wondering if it will work without the javascript based on the theory of boiling down 
the problem to it's aboslute basics, and that would be: are you in fact set up 
correctly to submit 2 select tags at once.

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

Reply via email to