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 SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user