DUE TO SPAM, SIGN-UP IS DISABLED. Goto Selfserve wiki signup and request an account.
...
| Code Block |
|---|
Form nestedForm = new Form("nestedForm") {
@Override
public boolean isEnabled() {
return getRootForm().findSubmittingButton().getForm() == this;
}
};
|
Another way is to let your child form implement IFormVisitorParticipant as follows:
| Code Block |
|---|
class InternalForm<T> extends Form<T> implements IFormVisitorParticipant {
public InternalForm(String name) {
super(name);
}
public InternalForm(String name, IModel<T> model) {
super(name, model);
}
public boolean processChildren() {
IFormSubmittingComponent submitter = getRootForm().findSubmittingButton();
if (submitter == null)
return true;
return submitter.getForm() == this;
}
}
Form nestedForm = new InternalForm("nestedForm");
|