-
Aug 4th, 2006, 11:21 AM
#1
Using custom PropertyEditor with form taglib
Hello,
I have a problem figuring out how to use custom property editors to bind a complex command object on a form.
I have a form on a JSP (implemented using the form taglib from Spring 2.0RC2) backed by a command object.
In my controller, I have registered (in the initBinder() method) several custom property editor since many fields of the command objects are complex types.
When the form is submitted, the bindings work fine: the property editors are called to bind the request parameters on the complex types of the command object.
The problem is when I need to display (or redisplay) the form: every attribute mapped on an input field (form:input tag) seems to be bound to the attribute using a default property editor (I see in the input the same result as calling toString on the object)
Is there a way to define the property editors used to bind the object on the form? Or am I missing something ?
Thank you in advance for you help,
H. Devichi
-
Aug 7th, 2006, 10:24 AM
#2
In your property editor, did you implement:
String getAsText()?
Maybe show some code from a custom property editor.
-
Aug 7th, 2006, 10:41 AM
#3
Hello,
thanks for your reply!
I just found the problem, I think I had mixed things up quite a bit, the controller displaying the form was a multiaction controller (the other controller was only used to process submissions).
I have now only 1 controller (SimpleFormController) to display/process the form, and it works.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules