Wednesday, February 17, 2010

[Spring] CustomDateEditor and RedirectOnPause

Now, I'm having a similar custom property editor issue as in my previous post.
I've registered the following CustomDateEditor to my property editor registrar.

<bean class="org.springframework.beans.propertyeditors.CustomDateEditor" id="customDateEditor">
  <constructor-arg>
    <bean class="java.text.SimpleDateFormat"><constructor-arg value="dd.MM.yyyy HH:mm"/></bean>
  </constructor-arg>
  <constructor-arg value="true"/>
</bean>

Entering date's using the configured format works but when the form gets reloaded the date's toString() method is called instead of the getAsText method of the property editor.

This is due to redirectOnPause, which requires 'setupForm' in each view as a render-action.

No comments:

Post a Comment