I have a problem with following code:
AjaxFallbackButton button = new AjaxFallbackButton("button", commentForm) {

private static final long serialVersionUID = 1L;

@Override
protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
 //do some business stuff
                                 // ......

commentForm.setDefaultModel(new CompoundPropertyModel<Comment>(new
Comment()));
*target.addComponent(commentForm);*
target.addComponent(commentsPanel);

}
};

User after submitting form via ajax stays on the same page and the form is
cleared so that user can fill and submit the form once again.
On first submit everythings works well. On the second submit the form is not
submitted via ajax but in a regular way. The problem is in
target.addComponent(commentForm). When I removed that line everything worked
well.

-- 
Regards,
Predrag Spasojevic

Reply via email to