This forum is now a read-only archive. All commenting, posting, registration services have been turned off. Those needing community support and/or wanting to ask questions should refer to the Tag/Forum map, and to http://spring.io/questions for a curated list of stackoverflow tags that Pivotal engineers, and the community, monitor.

Submit AbstractWizardFormController via href url

Feb 21st, 2005, 08:40 AM

How do you submit a page to an AbstractWizardFormController from a href url?

I have a jsp page with a list of appointment times as urls. I also have a javascript function which inserts values into hidden form fields i.e. the date, appointment time etc and submits the form when one of these urls is clicked.

As things stand the referenceData method is called as the println statement appears in the console. The problem is that the page value has not been set when the page was submitted. Below is the code for the href and javascript.

These values should be sent to the wizard controller to be displayed in a confirmation screen. I am using the default getTargetPage method. Unfortunately the _target2 page variable isn't getting picked up in the referenceData method as I don't believe it is getting sent to the controller, therefore no proccess is occurring.

Is there a way around this?

Ideally I wouldn't use javascript and hidden fields but I could not find any other way to submit a form via urls.

Comment

Thanx for your input guys, I thought I had solved it by using buttons instead of urls and using css to make the button look like a url. That way I got rid of using Javascript which was cool as I am not a fan of Javascript, also it can be turned of which would break my site.

Unfortunately I ran into a problem, I was returning the value of the url clicked on as a parameter i.e. the values of the buttons where 9:00 9:45 10:30 etc in increments of 45.

Problem is I can't get the value of the button and pass it as a parameter unless I use Javascript onClick to set the hidden value.

If anyone knows of any other way then great let me know but I reckon I am stuck with this.

Comment

I have a 4 pages Wizard and am using AbstractWizardFormController,On success,the 4th page is shown and I have a hyperlink in this page which would take me to the second page.

I am able to display to the second page using button,but when I use the hyperlink the first page is only getting displayed.Actually when I go through the logs,the second page is being called but after that the first page is called.Hence the first page is fnally displayed to the user.
I 've tried to have a hidden field and set the target name onClick method but does'nt seem to work.