The following code creates a two radio buttons. Each option contains a date value that is successfully converted to a label of the format "yyyy-MM-dd". Once I make a selection and click the next button I get the following error "j_idt12:comDateChoice: Validation Error: Value is not valid". It seems simple enough but somethings wrong. Can any of you spot it?
I'm using JSF 2.0 in glassfish.
Backing bean
public List<SelectItem> getComDateList() {
List<SelectItem> items = new ArrayList<SelectItem>();
Calendar cal = GregorianCalendar.getInstance();
cal.set(Calendar.DAY_OF_MONTH, 1);
cal.add(Calendar.MONTH, 1);
Date nextFirst = cal.getTime();
cal.add(Calendar.MONTH, 1);
Date followingFirst = cal.getTime();
items.add(new SelectItem(nextFirst, new SimpleDateFormat("yyyy-MM-dd").format(nextFirst)));
items.add(new SelectItem(followingFirst, new SimpleDateFormat("yyyy-MM-dd").format(followingFirst)));
return items;
}
JSF Code
<h:panelGrid columns="2">
<h:outputLabel value="#{msg.FinanceCommencementDate}" for="comDateChoice"/>
<h:selectOneRadio id="comDateChoice" value="#{signUpBean.current.commencementDate}" layout="pageDirection">
<f:convertDateTime type="date" dateStyle="short"/>
<f:selectItems value="#{signUpBean.comDateList}"/>
</h:selectOneRadio>
</h:panelGrid>