Results 1 to 3 of 3

Thread: Using custom PropertyEditor with form taglib

Hybrid View

  1. #1
    Join Date
    Aug 2006
    Posts
    2

    Default 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

  2. #2
    Join Date
    Jul 2006
    Posts
    10

    Default

    In your property editor, did you implement:
    String getAsText()?

    Maybe show some code from a custom property editor.

  3. #3
    Join Date
    Aug 2006
    Posts
    2

    Default

    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
  •