use of org.zkoss.bind.BindContext in project collect by openforis.
the class BaseValidator method getVM.
@SuppressWarnings("unchecked")
protected <T extends BaseVM> T getVM(ValidationContext ctx) {
BindContext bindContext = ctx.getBindContext();
Binder binder = bindContext.getBinder();
Object vmObject = binder.getViewModel();
if (vmObject == null) {
throw new IllegalStateException("Unable to find view model instance");
}
return (T) vmObject;
}
Aggregations