View Full Version : Form calling another form does not call referenceData()
Sep 1st, 2004, 10:52 AM
I can't seem to find the problem to this one. I have a SimpleFormControler's onSubmit event that processes database stuff then needs, in some cases, to pass the model to another form for more data entry. I tried setFormView("edit"); return showForm() and return new ModelAndView("edit",errors.getModel()); and the new form loads with the model but the form's referenceData() is not called so my comboboxes are empty!
Is there a way to do it without AbstractWizardFormController??
Sep 1st, 2004, 03:41 PM
You'll have to trigger the second form controller, not just forward it to the view of the second form. When just returning the form view, the controller will never be triggered and the referenceData method will never get called (just as any other initailization methods of the form).
Use a RedirectView to redirect to the URL of the second form controller for instance. Result would be that you have to re-initialize the command object however, unless you put it in the session yourself and retrieve it again in the second form controller.
Remember: request causes controller to get trigger which returns a view. A view (unless you're using the RedirectView) can never cause actions to be performed on the controller.
Sep 2nd, 2004, 08:18 AM
Aaaaaah! Gotcha! That's what I was looking for. Thanks!
However, when the <"sessionForm"> property is set to "true" in the application context isn't the command already supposed to be in the session? In that case, is the command still there after the redirectView?
Powered by vBulletin® Version 4.2.1 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.