When writing AJAX-specific code for Wicket, in order to make any updates to a component, it needs to be added to the AjaxTarget. If you've got a particularly large form, this can get tedious, so use an IVisitor instead! @Override protected void onSubmit(final AjaxRequestTarget target, Form form) { form.visitFormComponents(new FormComponent.IVisitor() { public Object formComponent(IFormVisitorParticipant formComponent) { final FormComponent fc = (FormComponent)formComponent; target.addComponent(fc); return Component.IVisitor.CONTINUE_TRAVERSAL; } }); ...
Share this post
Add Form Component to AjaxTarget with…
Share this post
When writing AJAX-specific code for Wicket, in order to make any updates to a component, it needs to be added to the AjaxTarget. If you've got a particularly large form, this can get tedious, so use an IVisitor instead! @Override protected void onSubmit(final AjaxRequestTarget target, Form form) { form.visitFormComponents(new FormComponent.IVisitor() { public Object formComponent(IFormVisitorParticipant formComponent) { final FormComponent fc = (FormComponent)formComponent; target.addComponent(fc); return Component.IVisitor.CONTINUE_TRAVERSAL; } }); ...