Hi
I solved the problem myself
Here is the situation : I display the form in this view state
Code:
<view-state id="edit">
<on-render>
<evaluate expression="productManager.reattach(product)" result="flowScope.product" />
</on-render>
<transition on="save" to="save">
<evaluate expression="productAction.bindAndValidate"/>
<evaluate expression="productManager.save(product)" />
</transition>
</view>
edit.jsp has a date field
Code:
<form:input path="endPromotion" cssErrorClass="errors" size="10" />
productAction register a dateEditor, but it doesn't help, because the first time we display the form edit.jsp, we do not call productAction. And thus the editor is ignored and the date is diplayed in the field simply calling the toString() method of java.util.Date.
To make sure on what I'm saying I correctly filled the date field and manage to have a validation errors on an other part of the form, in this case we passed by productAction thus triggering the date editor and the date is correctly displayed in the field.
The solution was simple just call productAction.setupForm to trigger the date editor.
Code:
<view-state id="edit">
<on-render>
<evaluate expression="productManager.reattach(product)" result="flowScope.product" />
<!-- force the use of the date editor -->
<evaluate expression="productAction.setupForm" />
</on-render>
<transition on="save" to="save">
<evaluate expression="productAction.bindAndValidate"/>
<evaluate expression="productManager.save(product)" />
</transition>
</view>
And the problem is solved.
But this solution let me think that something is not really consitent, in one hand we want to get rid of all the action class by setting the model directly from the layer service and in the other we are still forced to call them to have data properly binded and displaid.
In the 2.0.0RC1 booking-mvc sample we don't even call any Action class, and I guess that's why we introduce the model attribute.
But I could not figure how you say to the model how to edit the date. But I guess the documentation on this point is coming soon