telcontar4
Sep 8th, 2004, 03:07 PM
After upgrading from v1.0.2 to v1.1 yesterday, I have encountered a problem with the CustomDateEditor. Essentially, it neither formats the java.util.Date property in my INPUT field (it displays using the default date format) nor recognizes dates of any format when submitting the form (the property value is null, thus generating a validation error). This all worked fine in 1.0.2.
Excerpt from JSP
<form method="post">
...other fields...
<label>
Order Date
<spring:bind path="order.orderDate">
<input type="text" class="text-medium"
name="<c:out value="${status.expression}"/>"
value="<c:out value="${status.value}"/>">
<span class="error"><c:out value="${status.errorMessage}"/></span>
</spring:bind>
</label>
<input type="submit" class="button" value="Save"/>
</form>
Excerpt from AbstractWizardFormController subclass
protected void initBinder(HttpServletRequest request,ServletRequestDataBinder binder) throws Exception {
super.initBinder(request, binder);
DateFormat dateFormat = DateFormat.getDateInstance(DateFormat.SHORT);
binder.registerCustomEditor(Order.class, "orderDate", new CustomDateEditor(dateFormat, true));
...registration of other custom PropertyEditors that work fine...
}
I looked in the changelog.txt and on this forum, but could not see anything to suggest why this code no longer works. Can anyone help me out?
Thanks,
Excerpt from JSP
<form method="post">
...other fields...
<label>
Order Date
<spring:bind path="order.orderDate">
<input type="text" class="text-medium"
name="<c:out value="${status.expression}"/>"
value="<c:out value="${status.value}"/>">
<span class="error"><c:out value="${status.errorMessage}"/></span>
</spring:bind>
</label>
<input type="submit" class="button" value="Save"/>
</form>
Excerpt from AbstractWizardFormController subclass
protected void initBinder(HttpServletRequest request,ServletRequestDataBinder binder) throws Exception {
super.initBinder(request, binder);
DateFormat dateFormat = DateFormat.getDateInstance(DateFormat.SHORT);
binder.registerCustomEditor(Order.class, "orderDate", new CustomDateEditor(dateFormat, true));
...registration of other custom PropertyEditors that work fine...
}
I looked in the changelog.txt and on this forum, but could not see anything to suggest why this code no longer works. Can anyone help me out?
Thanks,