* @param component UIComponent instance
* @param value Value to check
* @param requiredFields Array of required field names (ending with)
+ * @param allowNull Wether null or empty values are allowed
* <p>
* @throws ValidatorException If something more horrible went wrong
*/
- protected void preValidate (final FacesContext context, final UIComponent component, final Object value, final String[] requiredFields) throws ValidatorException {
+ protected void preValidate (final FacesContext context, final UIComponent component, final Object value, final String[] requiredFields, boolean allowNull) throws ValidatorException {
// Trace message
//this.getLogger().logTrace(MessageFormat.format("preValidate: context={0},component={1},value={2},requiredFields={3} - CALLED!", context, component, value, Arrays.toString(requiredFields))); //NOI18N
isValidField = true;
// Is it null?
- if (null == value) {
+ if ((!allowNull) && (null == value)) {
// Value it null
facesMessage = new FacesMessage(MessageFormat.format("Field {0} is null.", field)); //NOI18N
}