use of org.olat.core.util.component.FormComponentTraverser in project openolat by klemens.
the class Form method reset.
/**
* @param ureq
*/
public void reset(UserRequest ureq) {
ResettingFormComponentVisitor rfcv = new ResettingFormComponentVisitor();
FormComponentTraverser ct = new FormComponentTraverser(rfcv, formLayout, false);
// calls reset on all elements!
ct.visitAll(ureq);
//
evalAllFormDependencyRules(ureq);
//
formWrapperComponent.fireFormEvent(ureq, FormEvent.RESET);
hasAlreadyFired = true;
}
use of org.olat.core.util.component.FormComponentTraverser in project openolat by klemens.
the class Form method submit.
private final void submit(UserRequest ureq, Event validationOkEvent) {
ValidatingFormComponentVisitor vfcv = new ValidatingFormComponentVisitor();
FormComponentTraverser ct = new FormComponentTraverser(vfcv, formLayout, false);
ct.visitAll(ureq);
// validate all form elements and gather validation status
ValidationStatus[] status = vfcv.getStatus();
//
boolean isValid = status == null || status.length == 0;
for (Iterator<FormBasicController> iterator = formListeners.iterator(); iterator.hasNext(); ) {
FormBasicController fbc = iterator.next();
// let all listeners validate and calc the total isValid
// let further validate even if one fails.
isValid = fbc.validateFormLogic(ureq) && isValid;
}
formWrapperComponent.fireValidation(ureq, isValid, validationOkEvent);
isValidAndSubmitted = isValid;
hasAlreadyFired = true;
}
use of org.olat.core.util.component.FormComponentTraverser in project openolat by klemens.
the class Form method evalAllFormDependencyRules.
/**
* @param ureq
*/
void evalAllFormDependencyRules(UserRequest ureq) {
FormDependencyRulesInitComponentVisitor fdrocv = new FormDependencyRulesInitComponentVisitor();
FormComponentTraverser ct = new FormComponentTraverser(fdrocv, formLayout, false);
// visit all container and eval container with its elements!
ct.visitAll(ureq);
}
Aggregations