Does the ActionForm for the bottom form only come into play when a selection is made in the upper form?
If so, you could always instantiate the ActionForm yourself, populate it as appropriate in the Action that fires when that selection is made, shove it in request and deal with it manually. One exceedingly hacky way to do this, and I'm not sure it would work but it would be a neat experiment, is something like this: In the Action: -------------- MyLowerActionForm m = new MyLowerActionForm(); // Populate ActionForm as appropriate request.setAttribute("m", m); (of course you wouldn't use "m" as the key, but you get the idea!) Then in your JSP, have the upper form that is exactly like it probably is now, then, right before the lower form, add this line: <% request.setAttribute("XXXX", request.getAttribute("m")); %> XXXX is the key that the ActionForm would be found under if the lower form was the only one involved. Then code your form as usual. What I'm thinking is that you'd want to use the same usual tags for both forms, and allow Struts to do its thing as far as populating and such goes... this obviously won't work if the upper form requires a different ActionForm than the bottom, but if you overwrite the ActionForm that would be in request at that point for the upper form with the one you manually added to request for the bottom form, that might work. *IF* that does work, I'm not at all sure it's a good idea, but it's an intersting thought. -- Frank W. Zammetti Founder and Chief Software Architect Omnytex Technologies http://www.omnytex.com On Thu, July 7, 2005 12:46 pm, Andrew Tomaka said: > I did consider using a single form bean for both forms, but it didn't > really sit well with me from a design stand point. We have two > different forms doing two different things so there should be two > different beans. Heck, if I had it my way, the two forms would be on > separate pages (wizard style), but the customer says otherwise. > > I do have an issue with using a single form. The top list is a list > of program ids. When a program id is selected, it brings up all the > different sheets for that program id. The user can then select a > sheet to edit, via radio button, and submit that request. With this > request, I need to pass the program id that was selected (via hidden > field). I can't rely on the program id in the drop down box because > if a user performs a search, changes the drop down box and then > selects a sheet to edit, we have a mismatch between the intended > program id to edit and the actual program id to edit (if that makes > any sense). > > ~ Andrew Tomaka > > On 7/7/05, Wendy Smoak <[EMAIL PROTECTED]> wrote: >> From: "Andrew Tomaka" <[EMAIL PROTECTED]> >> >> > My problem is that I have a "PreAction" to do the processing on the >> > form. This requires the page to have the form bean assigned to it. >> > Since I have two different forms doing two different things, I should >> > have two different form beans, but I don't see how I can accomplish >> > that. >> >> There's nothing wrong with sharing one form across multiple Actions. I >> do >> it for an accounting reporting webapp. All of the forms ask for similar >> things, such as account numbers and dates, and this makes it simple for >> all >> the HTML forms to "remember" their selections. (The form is in session >> scope, so it happens naturally.) >> >> Just wanted to point out that there is no ironclad one-to-one >> relationship >> between HTML forms and form beans. >> >> -- >> Wendy Smoak >> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: [EMAIL PROTECTED] >> For additional commands, e-mail: [EMAIL PROTECTED] >> >> > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]