5.0.12 Snapshot

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 regular
submission, and not one handled through AJAX.  More specifically, 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.

I am just wondering if this is working as intended and whether or not anyone
else has encountered this.  If not, would this be classified as a bug?  I
have included some test code below.

Thanks,

Eric

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() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    Object onSuccess() {
        JSONObject response = new JSONObject();
        response.put("content", "test me");
        return new JSONStreamResponse(response);
    }
}

Reply via email to