What steps will reproduce the problem?
1.Use a <sj:submit> inside a <s:form> without use the "formId" attribute
2.Do not use "id" attribute at parent <s:form>
What is the expected output?
The <sj:submit> use the id from parent form
What do you see instead?
The <sj:submit> do not use the id from parent form. So a "non ajax" post is
done when the form is submitted.
Which struts2 version?
2.1.8
Which struts2-jquery plugin version?
1.8.3
A Javascript exception is thrown, according Firefox:
$closestform.attr is not a function
Source: http://<host and
port>/<context>/struts/js/struts2/jquery.struts2.js (Line: 439)
(or line 18 when using the compressed JS file)
IF you use the "id" attribute at parent <s:form> everything goes ok. But
many developers do not use this attribute because Struts2 fill this with
the "action" attribute if "id" is not filled.
For example, the tag
<s:form action="gothere">
is rendered as
<form action="gothere" id="gothere" name="gothere" method="post">
But, <sj:submit> only get the "id" from parent <s:form> if this have the
"id" attribute filled.
<sx:submit> (from dojo plugin) does not have this bug.
Original issue reported on code.google.com by jyoshiriro on 26 Feb 2010 at 6:40
Original issue reported on code.google.com by
jyoshiriro
on 26 Feb 2010 at 6:40