Robin Ericsson wrote the following on 1/25/2005 10:29 AM:

I'm new to struts and trying to understand all the new things, but this is my problem right now.


I have two forms, one form used for a select-list, and another form that will be dynamically build based on the value selected in the first list.

So, how would I go on doing this? I've come so far that the first form is working through an action-class, but how should I request information from the form in the action and how should I save the dynamic data so it can be used by the view (jsp-page)?

One idea might be to save the data from the first form on http-session, and then in the "viewprepareaction" I store the dynamic generated data on the request as a Collection ?

Well there a few things I guess to ask first. Is the first form 'only' used to get an item from the select list? or does it have other information that needs to be saved (ie like a wizard where you go from page to page).


So, If the first page is to be used only to figure out how to populate the next page based on a parameter selected from the select list, just have the form submit to your Action (assuming a dispatch action it might go to "setUpForm" and in that method you pull out from the Request what the user selected and then use that for whatever you need in oder to populate your action form and then forward on to the form.jsp.

If the first form is used for more than just getting a parameter (you collected data that you need to retain) than I would make the form session scoped in your struts-config and anything entered on that first form will also remain in the form that I'm assuming you are then going to foward to again after you do what you need to do when you get the parameter you want from the select list.


-- Rick

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



Reply via email to