  | Mailing List | | Home | | Forum Home | | JBoss - Java Application Server | | Tomcat - JSP/Servlet container | | Struts - A MVC web framework | | iText - An open source PDF Java Library | | JDOM - JDOM XML Parser | | JSP - A mailing list about Java Server Pages specification and reference | | J2EE - A mailing list for Java(tm) 2 Platform, Enterprise Edition | | J2EE Pattern - An interest list for Sun Java Center J2EE Pattern Catalog | | Servlet - A mailing list for discussion about Sun Microsystem's Java Servlet API Technology | |
Struts & Hibernate
|
|
|
  | | | Multiple AJAX submit buttons in STRUTS 2 | Multiple AJAX submit buttons in STRUTS 2 2007-11-07 - By Jeromy Evans
Back Yes it possible and your attempt at specifying a different action for each submit button is correct.
However: Did you include <s:head theme="ajax">? If not, it's just doing a normal submit, not XHR and that may explain the problem. I think you should give your form a default action even though you won't use it. The two submit tags are correct Don't forget to use s:url to define the URL for your div Finally, use Firebug or Fiddler to see what each post actually contains.
Hope that helps, Jeromy Evans
kingysball wrote: > As part of my STRUTS 2 application i'm trying to use the AJAX theme to give > me 2 submit buttons within a Form that I can use to submit data to either > different Actions or different Methods in the same Action. Initially i > tried the following - > > <html> > <s:div id="persons" theme="ajax" href="%{descrsUrl}" /> > <s:form > > <s:textfield id="firstName" label="test" name="test"/> > <s:submit theme="ajax" targets="persons" action="test" /> > <s:submit theme="ajax" targets="persons" action="simpleAJAX" /> > </s:form> > </html> > > but this code only ever submits to the same Action. Is this posisble?? Can > I use the AJAX theme to submit data to different functions from within the > same Form??? > > Any help much appreciated. >
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------ To unsubscribe, e-mail: user-unsubscribe@(protected) For additional commands, e-mail: user-help@(protected)
|
|
 |