You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Eelco Hillenius (JIRA)" <ji...@apache.org> on 2007/10/16 08:35:51 UTC

[jira] Resolved: (WICKET-645) Form with ajaxsubmitbutton won't submit after error

     [ https://issues.apache.org/jira/browse/WICKET-645?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Eelco Hillenius resolved WICKET-645.
------------------------------------

       Resolution: Fixed
    Fix Version/s: 1.3.0-beta5

Should be fixed as part of another issue recently.

> Form with ajaxsubmitbutton won't submit after error
> ---------------------------------------------------
>
>                 Key: WICKET-645
>                 URL: https://issues.apache.org/jira/browse/WICKET-645
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.3.0-beta1
>            Reporter: Marieke Vandamme
>             Fix For: 1.3.0-beta5
>
>
> Posted on the mailing list :
> Hello, 
> I'm using the Apache Wicket incubating 1.3 and updated my existing application. 
> One of my forms wasn't working anymore. I isolated my problem in the code below. 
> I'm using a form with an AjaxSubmitButton. On my form, one of my components is required. 
> When user doesn't fill in field and presses the ajaxsubmitbutton, he gets an alert telling hem to fill in the required field. 
> When user then fills in field and presses submitbutton again, the onError is again called instead of the onsubmit. 
> Is this a bug (or is it already reported)? 
> Thanks in advance. 
> ------------------------------------------------------------------------------------------------------------------------------ 
> public class TestPage extends WebPage { 
>   public TestPage() { 
>     Form frm = new TestForm("form"); 
>     frm.add(new TestSubmitButton("button", frm)); 
>     frm.add(new RequiredTextField("name", new PropertyModel(frm, "name"))); 
>     add(frm); 
>   } 
>   
>   public class TestForm extends Form { 
>     private String name = null; 
>     public TestForm(String id){ 
>       super(id); 
>     } 
>     public void setName(String name){ 
>       name = name; 
>     } 
>     public String getName(){ 
>       return name; 
>     } 
>   } 
>   
>   public class TestSubmitButton extends AjaxSubmitButton { 
>     public TestSubmitButton(String id, Form form) { 
>       super(id, form); 
>     } 
>     protected void onSubmit(AjaxRequestTarget ajaxRequestTarget, Form form){ 
>       System.out.println("Form submitted"); 
>     } 
>     protected void onError(final AjaxRequestTarget target, Form form) { 
>       target.appendJavascript("alert('Fill in all fields.');"); 
>     } 
>   } 
> }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.