aspose file tools
The moose likes Struts and the fly likes Tiles Multiform submit Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Frameworks » Struts
Reply Bookmark "Tiles Multiform submit" Watch "Tiles Multiform submit" New topic
Author

Tiles Multiform submit

Ashwin Puthran
Greenhorn

Joined: Mar 25, 2009
Posts: 6
HI,

I have embedded 3 forms into my web page using tiles framework.
all 3 forms have some information(i.e text fields) with submit button on the 3 rd form.
Now on click of the submit button on 3rd form i wanna send all data present in 3 forms by populating a formbean and directing to a particular struts action
Hw do i do this?..Coz i hv only submitted one form at a tym from a jsp page.
Is there a way to merge alll form elements to populate a single form bean before submitting the form,
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

You'd have to do it with JavaScript.
Amandeep Singh
Ranch Hand

Joined: Jul 17, 2008
Posts: 837
yes there is a possibility to merge three forms into 1- but that requires you to make a 1 common action submit for all 3 forms.

other way as David suggested it can be done in Javascript.


SCJP 1.4, SCWCD 5, SCBCD 5, OCPJWSD 5,SCEA-1, Started Assignment Part 2
My blog- http://rkydesigns.blogspot.com
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

You can't have three separate forms on a single page submit to the same action--it needs to either be a single form, or use hidden fields/etc. to store fields from the other forms, which would need to be filled on submit.
Amandeep Singh
Ranch Hand

Joined: Jul 17, 2008
Posts: 837
David Newton wrote:You can't have three separate forms on a single page submit to the same action--it needs to either be a single form, or use hidden fields/etc. to store fields from the other forms, which would need to be filled on submit.


As i said in my previous posts. Make 3 forms into 1 form.
Ashwin Puthran
Greenhorn

Joined: Mar 25, 2009
Posts: 6
Hey guys,
Thanks for your help.I have used hidden fields to store the required info as of now. But i seriously feel that there should have been some alternative to store multiple form fields to a single formbean and then submit on a single action.
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Why? Normally if you have different forms you'd want them processed by different back-end logic--why else would you have separate forms?
Shriram Pandit
Greenhorn

Joined: Apr 08, 2011
Posts: 11
Thanks David I am using struts tiles and multiple form submission is worked for me using Javascript
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Tiles Multiform submit
 
Similar Threads
Three forms in jsp page
validation with struts and tiles
java script
The old mutliple pages submit to one action problem...
Struts passing data across tiles