Uploaded image for project: 'Struts 2'
  1. Struts 2
  2. WW-3584

convertToString in custom StrutsTypeConverter not called for multiple-valued tags (checkboxlist and select)

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.2.1.1
    • 2.3.20
    • Core Actions
    • None
    • Important

    Description

      I wrote a custom converter to map a list of custom type (List<MyBean>) to a s:checkboxlist tag. When I submit the form the convertFromString() method is called, so I have the list correctly populated with the selected values.

      The problem is that it doesn't work the other way: when I try to pre-populate the form from the values in the list, the tag is always empty, because the convertToString() method is never called. Same happens for s:select with multiple="true".

      I think it is a bug because if I change the tag to s:textfield, mapped to the same list, convertToString() is called and text box is populated.

      Attachments

        1. multivalueTest.zip
          2 kB
          Antonino Virgillito
        2. checkboxlist.ftl
          2 kB
          Maurizio Cucchiara
        3. checkboxlist.ftl
          2 kB
          sebastien b.

        Activity

          People

            maurizio.cucchiara Maurizio Cucchiara
            virgillito Antonino Virgillito
            Votes:
            3 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: