gmazza
Apr 25th, 2006, 08:57 AM
Hello,
I have a simple two-form web app, consisting of a database login form which will then activate a report parameter form. After the user selects desired parameters for the report, he can select "Submit" and have a PDF report returned to his browser.
The login form is working fine but I can't seem to get the referenceData() method from my ParameterFormController to be called on the initial display of the parameter view. (rD() for the PFC holds lookup values that are to populate drop-down lists on the parameter form.) Subsequent displays of the same view--due to validation errors, for example--*will* cause the rD() method to be called, and the form drop-down lists populated. (I confirmed that rD() isn't being called on the initial display of the parameter form by placing a debugging statement within that method.)
One temporary hack I can do is to add the lookup values already in rD() to the onSubmit() of my LoginFormController -- but obviously I'd like to avoid duplicating the code in two different places, as well as not maintain parameter-form specific data in the LFC.
I suspect the problem is with the way I am activating the parameter form. Here is my process:
1.) I have a www.mycompany.com/login.do map directly to the LoginFormController using the SimpleUrlHandlerMapping in my Spring configuration file. No problem here.
2.) Within the onSubmit() of LoginFormController, I forward directly to the parameter.jsp file (using the ResourceBundleViewResolver), adding only a ParameterForm object (which will store the user's choices) to the Model. No PFC.rD() called here, which is my problem.
3.) Within the POST action of the HTML form within the parameter.jsp, I declare an action called "parameter.do" that links directly to parameterFormController within my Spring configuration file just like #1 above. PFC.rD() is properly called here, and the drop-down lists filled if my parameter form is redisplayed due to validation errors.
How do I recode #2 to have the PFC.rD() be called?
Thanks,
Glen
I have a simple two-form web app, consisting of a database login form which will then activate a report parameter form. After the user selects desired parameters for the report, he can select "Submit" and have a PDF report returned to his browser.
The login form is working fine but I can't seem to get the referenceData() method from my ParameterFormController to be called on the initial display of the parameter view. (rD() for the PFC holds lookup values that are to populate drop-down lists on the parameter form.) Subsequent displays of the same view--due to validation errors, for example--*will* cause the rD() method to be called, and the form drop-down lists populated. (I confirmed that rD() isn't being called on the initial display of the parameter form by placing a debugging statement within that method.)
One temporary hack I can do is to add the lookup values already in rD() to the onSubmit() of my LoginFormController -- but obviously I'd like to avoid duplicating the code in two different places, as well as not maintain parameter-form specific data in the LFC.
I suspect the problem is with the way I am activating the parameter form. Here is my process:
1.) I have a www.mycompany.com/login.do map directly to the LoginFormController using the SimpleUrlHandlerMapping in my Spring configuration file. No problem here.
2.) Within the onSubmit() of LoginFormController, I forward directly to the parameter.jsp file (using the ResourceBundleViewResolver), adding only a ParameterForm object (which will store the user's choices) to the Model. No PFC.rD() called here, which is my problem.
3.) Within the POST action of the HTML form within the parameter.jsp, I declare an action called "parameter.do" that links directly to parameterFormController within my Spring configuration file just like #1 above. PFC.rD() is properly called here, and the drop-down lists filled if my parameter form is redisplayed due to validation errors.
How do I recode #2 to have the PFC.rD() be called?
Thanks,
Glen