use of org.olat.core.gui.components.form.flexible.elements.DateChooser in project openolat by klemens.
the class DatePropertyHandler method isValid.
/**
* @see org.olat.user.propertyhandlers.UserPropertyHandler#isValid(org.olat.core.gui.components.form.flexible.FormItem, java.util.Map)
*/
@Override
public boolean isValid(User user, FormItem formItem, Map<String, String> formContext) {
DateChooser dateElem = (DateChooser) formItem;
if (dateElem.isEmpty()) {
return !dateElem.isMandatory() || !dateElem.isEmpty("new.form.mandatory");
}
List<ValidationStatus> validation = new ArrayList<ValidationStatus>();
dateElem.validate(validation);
if (validation.size() == 0) {
return true;
} else {
// errorkey should be set by dateElem.validate formItem.setErrorKey(i18nFormElementLabelKey()+ ".error", null);
return false;
}
}
use of org.olat.core.gui.components.form.flexible.elements.DateChooser in project openolat by klemens.
the class MetadatasStepController method forgeRow.
private DueDateWrapper forgeRow(int i, FormLayoutContainer tableCont) {
String title = data.getNodePrefix() + " " + (i + 1);
TextElement titleEl = uifactory.addTextElement("title_" + i, null, 32, title, tableCont);
titleEl.setDisplaySize(21);
DateChooser dueDateEl = uifactory.addDateChooser("duedate_" + i, "config.due.date", null, tableCont);
dueDateEl.setDateChooserTimeEnabled(true);
DueDateWrapper wrapper = new DueDateWrapper(titleEl, dueDateEl);
return wrapper;
}
Aggregations