Search in sources :

Example 1 with BindContext

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;
}
Also used : BindContext(org.zkoss.bind.BindContext) Binder(org.zkoss.bind.Binder)

Aggregations

BindContext (org.zkoss.bind.BindContext)1 Binder (org.zkoss.bind.Binder)1