--- Adam Hardy <[EMAIL PROTECTED]> wrote: > I have two actions chained together. They both take > the same formbean. > The first is sectionInsert.do and the second, which > sectionInsert > forwards to on success, is sectionEdit.do > > sectionInsert.do receives the properties of a > Section in the request > parameters, including id=0 where it is 0 because it > does not exist in > the DB yet. So it inserts the new Section into the > DB and returns the > new id, which is needed by sectionEdit to put into > the html for the edit > page. > > I originally thought I could save the new id to the > formbean and this > would get passed on, but sectionEdit instantiates > its own formbean and > fills it with the request parameters - include id=0.
Out of curiosity, is it really making a new one, or just putting the request data in to the existing Form, again? > Is there an intuitive way of passing on the new id? > > I already use sectionEdit.do as a first action by > calling it with an id > on a querystring, where the formbean picks it up. I > would like to use a > method that is easy for both these situations. > > I'd appreciate any inspiration. How about putting in another Form property which will never be populated from a request? If this property is populated, ignore the property Struts populated from the request. I guess this depends on my assumption above, but if Struts really is making a new Form, you could still put this new property in the request, and make sure it happens only in the Action you chain from, and never from the HTML you render. > Adam > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: > [EMAIL PROTECTED] > For additional commands, e-mail: > [EMAIL PROTECTED] > __________________________________ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]