@Override public void onClick(final AjaxRequestTarget target) { //set all links enabled AjaxLinkGroup.this.visitChildren(AjaxLink.class, new IVisitor<AjaxLink<T>>() { @Override public Object component(AjaxLink<T> component) { component.setEnabled(true); target.addComponent(component); return CONTINUE_TRAVERSAL_BUT_DONT_GO_DEEPER; } }); //set this link disabled setEnabled(false); //update //target.addComponent(AjaxLinkGroup.this.getParent()); target.addComponent(this); AjaxLinkGroup.this.onClick(this, target); } }.setOutputMarkupId(true);
protected AjaxLink<T> newLink(String id, IModel<T> model) { return (AjaxLink<T>) new AjaxLink<T>(id, model) { @Override public void onClick(final AjaxRequestTarget target) { // set all links enabled AjaxLinkGroup.this.visitChildren( AjaxLink.class, (component, visit) -> { component.setEnabled(true); target.add(component); visit.dontGoDeeper(); }); // set this link disabled setEnabled(false); // update // target.add(AjaxLinkGroup.this.getParent()); target.add(this); AjaxLinkGroup.this.onClick(this, target); } }.setOutputMarkupId(true); }
@Override public void onClick(final AjaxRequestTarget target) { //set all links enabled AjaxLinkGroup.this.visitChildren(AjaxLink.class, new IVisitor<AjaxLink<T>>() { @Override public Object component(AjaxLink<T> component) { component.setEnabled(true); target.addComponent(component); return CONTINUE_TRAVERSAL_BUT_DONT_GO_DEEPER; } }); //set this link disabled setEnabled(false); //update //target.addComponent(AjaxLinkGroup.this.getParent()); target.addComponent(this); AjaxLinkGroup.this.onClick(this, target); } }.setOutputMarkupId(true);
@Override public void onClick(final AjaxRequestTarget target) { // set all links enabled AjaxLinkGroup.this.visitChildren( AjaxLink.class, (component, visit) -> { component.setEnabled(true); target.add(component); visit.dontGoDeeper(); }); // set this link disabled setEnabled(false); // update // target.add(AjaxLinkGroup.this.getParent()); target.add(this); AjaxLinkGroup.this.onClick(this, target); } }.setOutputMarkupId(true);