I'm using an AjaxFormSubmitBehavior to render a little indicator on the ongoing Ajax request which gets triggered
when the user clicks on the AjaxSubmitButton. The only problem is that the form is getting sumitted prior to showing
the results ignoring ajax. If I remove the AjaxFormSubmitBehavior it works fine. The onSubmit of the AjaxSubmitButton is never called.
By the time the onSubmit ofAjaxFormSubmitBehavior is called the form has already been submitted. How would I go about fixing this?
Thank you for your time
public
LookupEmployeeForm(String id, IModel model) { super(id, model);add(
new TextField("cn"));add(
imgContainer);add(
ajaxButton = new AjaxSubmitButton("ajaxLDAPSearch", this) { protected void onSubmit(AjaxRequestTarget target, Form form) {System.out.println("This never gets called");
}
});
ajaxButton.add(new AjaxFormSubmitIndicator());}
private class AjaxFormSubmitIndicator extends AjaxFormSubmitBehavior implements IAjaxIndicatorAware { public AjaxFormSubmitIndicator() { super(LookupEmployeeForm.this, "onclick");}
public String getAjaxIndicatorMarkupId() { return imgContainer.getMarkupId();}
@Override protected void onSubmit(AjaxRequestTarget target) {List<LDAPUser> list =
ldapDao.getSearchResults((LDAPUser)employeeForm.getModelObject()); ldapUserDB.setUsers(list);target.addComponent(
ajaxTable);target.addComponent(
imgContainer);System.
out.println("This gets called");}
}
Live U's list of the best places to Eat, Study & Party
------------------------------------------------------------------------- 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