Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Duplicate
-
5.0.12
-
None
-
Windows Vista Home Premium,
Firefox 2.0.0.14,
Internet Explorer 7.0.6000.16643,
Description
If I have a page containing a form and an associated Zone component to update, everything works as expected. However, when I add validation to a field on the form, the submission for the form is treated as a non-AJAX submission.
More specifically, from looking at the tapestry.js script, it appears that when the page is loaded, the form's onsubmit event handler is at first bound properly. However, the Tapestry.FormEventManager appears to rebind the onsubmit event to its own handleSubmit function, completely ignoring the previous event handler.
Below is some code for a Test page, which I created to demonstrate the issue:
Test.tml:
<t:Zone t:id="statusZone"/>
<t:Form t:Zone="statusZone">
<t:TextField t:id="name" t:value="name"/>
<t:Submit/>
</t:Form>
Test.java:
public class Test {
private String name;
//if we remove @Validate("required"), everything works as expected.
@Validate("required")
public String getName()
public void setName(String name)
{ this.name = name; }Object onSuccess()
{ JSONObject response = new JSONObject(); response.put("content", "test me"); return new JSONStreamResponse(response); }
}