package com.rjconsultores.ventaboletos.web.utilerias;

import org.zkoss.util.resource.Labels;
import org.zkoss.zk.ui.Component;
import org.zkoss.zk.ui.WrongValueException;
import org.zkoss.zul.Constraint;

public class ConstraintNoEmpty implements Constraint {
	@Override
	public void validate(Component component, Object value) throws WrongValueException {
		if (value == null || value.toString().isEmpty()) {
			throw new WrongValueException(component, Labels.getLabel("MSG.CONSTRAINT.CAMPOOBRIGATORIO"));
		}
	}
}
