Search in sources :

Example 1 with XmlGregorianCalendarModel

use of com.evolveum.midpoint.web.model.XmlGregorianCalendarModel in project midpoint by Evolveum.

the class DateFormGroup method initLayout.

private void initLayout(IModel<String> label, String labelSize, String textSize, boolean required) {
    Label l = new Label(ID_LABEL, label);
    if (StringUtils.isNotEmpty(labelSize)) {
        l.add(AttributeAppender.prepend("class", labelSize));
    }
    add(l);
    WebMarkupContainer dateWrapper = new WebMarkupContainer(ID_DATE_WRAPPER);
    if (StringUtils.isNotEmpty(textSize)) {
        dateWrapper.add(AttributeAppender.prepend("class", textSize));
    }
    add(dateWrapper);
    DateInput date = new DateInput(ID_DATE, new XmlGregorianCalendarModel(getModel()));
    date.setRequired(required);
    date.setLabel(label);
    dateWrapper.add(date);
    FeedbackPanel feedback = new FeedbackPanel(ID_FEEDBACK, new ComponentFeedbackMessageFilter(date));
    dateWrapper.add(feedback);
}
Also used : ComponentFeedbackMessageFilter(org.apache.wicket.feedback.ComponentFeedbackMessageFilter) FeedbackPanel(org.apache.wicket.markup.html.panel.FeedbackPanel) XmlGregorianCalendarModel(com.evolveum.midpoint.web.model.XmlGregorianCalendarModel) Label(org.apache.wicket.markup.html.basic.Label) DateInput(com.evolveum.midpoint.web.component.DateInput) WebMarkupContainer(org.apache.wicket.markup.html.WebMarkupContainer)

Aggregations

DateInput (com.evolveum.midpoint.web.component.DateInput)1 XmlGregorianCalendarModel (com.evolveum.midpoint.web.model.XmlGregorianCalendarModel)1 ComponentFeedbackMessageFilter (org.apache.wicket.feedback.ComponentFeedbackMessageFilter)1 WebMarkupContainer (org.apache.wicket.markup.html.WebMarkupContainer)1 Label (org.apache.wicket.markup.html.basic.Label)1 FeedbackPanel (org.apache.wicket.markup.html.panel.FeedbackPanel)1