timeField.setRequired(required);
}
@Override
public ErrorMessage getErrorMessage() {
CompositeErrorMessage dateErrors = (CompositeErrorMessage)dateField.getErrorMessage();
CompositeErrorMessage timeErrors = (CompositeErrorMessage)timeField.getErrorMessage();
LinkedList<CompositeErrorMessage> allErrors = new LinkedList<CompositeErrorMessage>();
if(!dateField.isValid()){
allErrors.add(dateErrors);
}
if(!timeField.isValid()){
allErrors.add(timeErrors);
}
if(!allErrors.isEmpty())
return new CompositeErrorMessage(allErrors);
return null;
}