wood burning stoves 2.0*
The moose likes Struts and the fly likes Tiles Multiform submit Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
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: 844
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: 844
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
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Tiles Multiform submit