You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "Antonino Virgillito (JIRA)" <ji...@apache.org> on 2011/03/02 09:59:37 UTC

[jira] Created: (WW-3584) convertToString in custom StrutsTypeConverter not called for multiple-valued tags (checkboxlist and select)

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

                 Key: WW-3584
                 URL: https://issues.apache.org/jira/browse/WW-3584
             Project: Struts 2
          Issue Type: Bug
          Components: Core Actions
    Affects Versions: 2.2.1.1
            Reporter: Antonino Virgillito


I wrote a custom converter to map a list 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. 

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Issue Comment Edited] (WW-3584) convertToString in custom StrutsTypeConverter not called for multiple-valued tags (checkboxlist and select)

Posted by "sebastien b. (Issue Comment Edited) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WW-3584?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13234216#comment-13234216 ] 

sebastien b. edited comment on WW-3584 at 3/21/12 9:21 AM:
-----------------------------------------------------------

The bug is solved for me with the checkboxlist.ftl file corrected.

I modified this file only to add the css render.

Thanks !
CCordially.
                
      was (Author: sebmatrix):
    Just the precedent file with re-integration of css render.
                  
> convertToString in custom StrutsTypeConverter not called for multiple-valued tags (checkboxlist and select)
> -----------------------------------------------------------------------------------------------------------
>
>                 Key: WW-3584
>                 URL: https://issues.apache.org/jira/browse/WW-3584
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Core Actions
>    Affects Versions: 2.2.1.1
>            Reporter: Antonino Virgillito
>            Assignee: Maurizio Cucchiara
>             Fix For: 2.3.x
>
>         Attachments: checkboxlist.ftl, checkboxlist.ftl, multivalueTest.zip
>
>
> 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. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (WW-3584) convertToString in custom StrutsTypeConverter not called for multiple-valued tags (checkboxlist and select)

Posted by "Antonino Virgillito (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WW-3584?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Antonino Virgillito updated WW-3584:
------------------------------------

    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. 

  was:
I wrote a custom converter to map a list 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. 


> convertToString in custom StrutsTypeConverter not called for multiple-valued tags (checkboxlist and select)
> -----------------------------------------------------------------------------------------------------------
>
>                 Key: WW-3584
>                 URL: https://issues.apache.org/jira/browse/WW-3584
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Core Actions
>    Affects Versions: 2.2.1.1
>            Reporter: Antonino Virgillito
>
> 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. 

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (WW-3584) convertToString in custom StrutsTypeConverter not called for multiple-valued tags (checkboxlist and select)

Posted by "Alfredo Osorio (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WW-3584?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13005232#comment-13005232 ] 

Alfredo Osorio commented on WW-3584:
------------------------------------

It's also happening to me. I think the problem has something to do with:
 XWorkConverter 
     public Object convertValue(Map<String, Object> context, Object target, Member member, String property, Object value, Class toClass); 

and the way it finds the converter. For example giving the following:

myPage.jsp
<s:form>
<s:textfield name="a.b" label="myField"/>
</s:form>

MyAction-conversion.properties
a.b=com.afirme.autosoffline.converter.PercentDecimalConverter

And a corresponding property in my Action.

class MyAction {
 A getA() //
}

class A {
   BigDecimal b;
}

Just before convertFromString it's called the next line evaluates to:
Object lastPropertyPath = context.get(ReflectionContextState.CURRENT_PROPERTY_PATH);

"a" (it evaluates fine)

But when it is the case for convertToString that evaluates to:

"a.b" (wrong)

So when the following expression evaluates:
String path = lastPropertyPath + "." + property;
It is resolved to:
"a.b.b"

Evaluating to a wrong path for the corresponding property so no TypeConverter would be found.

Version tested: 2.2.1.1



> convertToString in custom StrutsTypeConverter not called for multiple-valued tags (checkboxlist and select)
> -----------------------------------------------------------------------------------------------------------
>
>                 Key: WW-3584
>                 URL: https://issues.apache.org/jira/browse/WW-3584
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Core Actions
>    Affects Versions: 2.2.1.1
>            Reporter: Antonino Virgillito
>            Assignee: Maurizio Cucchiara
>
> 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. 

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] Commented: (WW-3584) convertToString in custom StrutsTypeConverter not called for multiple-valued tags (checkboxlist and select)

Posted by "Maurizio Cucchiara (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WW-3584?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13001370#comment-13001370 ] 

Maurizio Cucchiara commented on WW-3584:
----------------------------------------


Ciao Antonino,
could you please post the following elements:
1. the  -conversion.properties.
2. the action's configuration inside your struts.xml (I'm assuming you're using it).
3. the tag directive inside your jsp file.


> convertToString in custom StrutsTypeConverter not called for multiple-valued tags (checkboxlist and select)
> -----------------------------------------------------------------------------------------------------------
>
>                 Key: WW-3584
>                 URL: https://issues.apache.org/jira/browse/WW-3584
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Core Actions
>    Affects Versions: 2.2.1.1
>            Reporter: Antonino Virgillito
>            Assignee: Maurizio Cucchiara
>
> 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. 

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Assigned: (WW-3584) convertToString in custom StrutsTypeConverter not called for multiple-valued tags (checkboxlist and select)

Posted by "Maurizio Cucchiara (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WW-3584?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Maurizio Cucchiara reassigned WW-3584:
--------------------------------------

    Assignee: Maurizio Cucchiara

> convertToString in custom StrutsTypeConverter not called for multiple-valued tags (checkboxlist and select)
> -----------------------------------------------------------------------------------------------------------
>
>                 Key: WW-3584
>                 URL: https://issues.apache.org/jira/browse/WW-3584
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Core Actions
>    Affects Versions: 2.2.1.1
>            Reporter: Antonino Virgillito
>            Assignee: Maurizio Cucchiara
>
> 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. 

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (WW-3584) convertToString in custom StrutsTypeConverter not called for multiple-valued tags (checkboxlist and select)

Posted by "Maurizio Cucchiara (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WW-3584?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13011162#comment-13011162 ] 

Maurizio Cucchiara commented on WW-3584:
----------------------------------------

Thanks Antonino,
I'll take a look at the attachment you sent ASAP

> convertToString in custom StrutsTypeConverter not called for multiple-valued tags (checkboxlist and select)
> -----------------------------------------------------------------------------------------------------------
>
>                 Key: WW-3584
>                 URL: https://issues.apache.org/jira/browse/WW-3584
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Core Actions
>    Affects Versions: 2.2.1.1
>            Reporter: Antonino Virgillito
>            Assignee: Maurizio Cucchiara
>         Attachments: multivalueTest.zip
>
>
> 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. 

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (WW-3584) convertToString in custom StrutsTypeConverter not called for multiple-valued tags (checkboxlist and select)

Posted by "Antonino Virgillito (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WW-3584?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Antonino Virgillito updated WW-3584:
------------------------------------

    Attachment: multivalueTest.zip

Here are the test files showing the issue. 

The zip contains: 
- bean class 
- action class
- conversion class (with configuration file)
- JSP file (form and checkboxlist)
- struts configuration

Some annotations:
- The conversion class containts prints for tracing the methods execution
- The JSP contains a commented textfield tag having the same name as the checkboxlist. When uncommenting the tag  convertToString is called. 
- If you change the name to colorStringValue the checkbox is populated (colorStringValue is a list of strings)


> convertToString in custom StrutsTypeConverter not called for multiple-valued tags (checkboxlist and select)
> -----------------------------------------------------------------------------------------------------------
>
>                 Key: WW-3584
>                 URL: https://issues.apache.org/jira/browse/WW-3584
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Core Actions
>    Affects Versions: 2.2.1.1
>            Reporter: Antonino Virgillito
>            Assignee: Maurizio Cucchiara
>         Attachments: multivalueTest.zip
>
>
> 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. 

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] Commented: (WW-3584) convertToString in custom StrutsTypeConverter not called for multiple-valued tags (checkboxlist and select)

Posted by "Antonino Virgillito (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WW-3584?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13006009#comment-13006009 ] 

Antonino Virgillito commented on WW-3584:
-----------------------------------------

Yes, it's broken. 
I apologize. 

Unfortunately I won't be able to recover the files until Monday as they are on my office pc. 

> convertToString in custom StrutsTypeConverter not called for multiple-valued tags (checkboxlist and select)
> -----------------------------------------------------------------------------------------------------------
>
>                 Key: WW-3584
>                 URL: https://issues.apache.org/jira/browse/WW-3584
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Core Actions
>    Affects Versions: 2.2.1.1
>            Reporter: Antonino Virgillito
>            Assignee: Maurizio Cucchiara
>         Attachments: multivalueTest.zip
>
>
> 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. 

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Issue Comment Edited] (WW-3584) convertToString in custom StrutsTypeConverter not called for multiple-valued tags (checkboxlist and select)

Posted by "Maurizio Cucchiara (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WW-3584?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13088236#comment-13088236 ] 

Maurizio Cucchiara edited comment on WW-3584 at 8/20/11 6:16 PM:
-----------------------------------------------------------------

Copying the attached file to webapp directory (or even to the classpath) along the {{/template/simple/}} path (according with http://s.apache.org/tmp) would seem to solve the problem.
Also you have to overwrite the {{toString}} method of the {{Color}} Class.
{code}
    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        Color color = (Color) o;

        return id == color.id;

    }

{code}

      was (Author: maurizio.cucchiara):
    Copying the attached file to webapp directory (or even to the classpath) along the {{/template/simple/}} path (according with http://s.apache.org/tmp) would seem to solve the problem.
  
> convertToString in custom StrutsTypeConverter not called for multiple-valued tags (checkboxlist and select)
> -----------------------------------------------------------------------------------------------------------
>
>                 Key: WW-3584
>                 URL: https://issues.apache.org/jira/browse/WW-3584
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Core Actions
>    Affects Versions: 2.2.1.1
>            Reporter: Antonino Virgillito
>            Assignee: Maurizio Cucchiara
>         Attachments: checkboxlist.ftl, multivalueTest.zip
>
>
> 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. 

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (WW-3584) convertToString in custom StrutsTypeConverter not called for multiple-valued tags (checkboxlist and select)

Posted by "Maurizio Cucchiara (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WW-3584?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13088243#comment-13088243 ] 

Maurizio Cucchiara commented on WW-3584:
----------------------------------------

Also I'm not sure that this problem has already been addressed  [here|http://struts.apache.org/2.x/docs/type-conversion.html#TypeConversion-AnadvancedexampleforindexedListsandMaps]

> convertToString in custom StrutsTypeConverter not called for multiple-valued tags (checkboxlist and select)
> -----------------------------------------------------------------------------------------------------------
>
>                 Key: WW-3584
>                 URL: https://issues.apache.org/jira/browse/WW-3584
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Core Actions
>    Affects Versions: 2.2.1.1
>            Reporter: Antonino Virgillito
>            Assignee: Maurizio Cucchiara
>         Attachments: checkboxlist.ftl, multivalueTest.zip
>
>
> 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. 

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (WW-3584) 2

Posted by "Lukasz Lenart (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WW-3584?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Lukasz Lenart updated WW-3584:
------------------------------

    Fix Version/s: 2.3.x
          Summary: 2  (was: convertToString in custom StrutsTypeConverter not called for multiple-valued tags (checkboxlist and select))
    
> 2
> -
>
>                 Key: WW-3584
>                 URL: https://issues.apache.org/jira/browse/WW-3584
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Core Actions
>    Affects Versions: 2.2.1.1
>            Reporter: Antonino Virgillito
>            Assignee: Maurizio Cucchiara
>             Fix For: 2.3.x
>
>         Attachments: checkboxlist.ftl, multivalueTest.zip
>
>
> 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. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (WW-3584) convertToString in custom StrutsTypeConverter not called for multiple-valued tags (checkboxlist and select)

Posted by "Maurizio Cucchiara (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WW-3584?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13006021#comment-13006021 ] 

Maurizio Cucchiara commented on WW-3584:
----------------------------------------

Don't worry, I have to admit that the attached zip maked me a little frustrated :)

> convertToString in custom StrutsTypeConverter not called for multiple-valued tags (checkboxlist and select)
> -----------------------------------------------------------------------------------------------------------
>
>                 Key: WW-3584
>                 URL: https://issues.apache.org/jira/browse/WW-3584
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Core Actions
>    Affects Versions: 2.2.1.1
>            Reporter: Antonino Virgillito
>            Assignee: Maurizio Cucchiara
>         Attachments: multivalueTest.zip
>
>
> 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. 

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (WW-3584) convertToString in custom StrutsTypeConverter not called for multiple-valued tags (checkboxlist and select)

Posted by "sebastien b. (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WW-3584?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

sebastien b. updated WW-3584:
-----------------------------

    Attachment: checkboxlist.ftl

Just the precedent file with re-integration of css render.
                
> convertToString in custom StrutsTypeConverter not called for multiple-valued tags (checkboxlist and select)
> -----------------------------------------------------------------------------------------------------------
>
>                 Key: WW-3584
>                 URL: https://issues.apache.org/jira/browse/WW-3584
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Core Actions
>    Affects Versions: 2.2.1.1
>            Reporter: Antonino Virgillito
>            Assignee: Maurizio Cucchiara
>             Fix For: 2.3.x
>
>         Attachments: checkboxlist.ftl, checkboxlist.ftl, multivalueTest.zip
>
>
> 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. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (WW-3584) convertToString in custom StrutsTypeConverter not called for multiple-valued tags (checkboxlist and select)

Posted by "Maurizio Cucchiara (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WW-3584?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Maurizio Cucchiara updated WW-3584:
-----------------------------------

    Attachment: checkboxlist.ftl

Copying the attached file to webapp directory (or even to the classpath) along the {{/template/simple/}} path (according with http://s.apache.org/tmp) would seem to solve the problem.

> convertToString in custom StrutsTypeConverter not called for multiple-valued tags (checkboxlist and select)
> -----------------------------------------------------------------------------------------------------------
>
>                 Key: WW-3584
>                 URL: https://issues.apache.org/jira/browse/WW-3584
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Core Actions
>    Affects Versions: 2.2.1.1
>            Reporter: Antonino Virgillito
>            Assignee: Maurizio Cucchiara
>         Attachments: checkboxlist.ftl, multivalueTest.zip
>
>
> 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. 

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Issue Comment Edited] (WW-3584) convertToString in custom StrutsTypeConverter not called for multiple-valued tags (checkboxlist and select)

Posted by "sebastien b. (Issue Comment Edited) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WW-3584?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13234216#comment-13234216 ] 

sebastien b. edited comment on WW-3584 at 3/21/12 9:24 AM:
-----------------------------------------------------------

The bug is solved for me with the checkboxlist.ftl file corrected.

I modified only this file to add the css render.

Thanks !
Cordially.
                
      was (Author: sebmatrix):
    The bug is solved for me with the checkboxlist.ftl file corrected.

I modified only this file to add the css render.

Thanks !
CCordially.
                  
> convertToString in custom StrutsTypeConverter not called for multiple-valued tags (checkboxlist and select)
> -----------------------------------------------------------------------------------------------------------
>
>                 Key: WW-3584
>                 URL: https://issues.apache.org/jira/browse/WW-3584
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Core Actions
>    Affects Versions: 2.2.1.1
>            Reporter: Antonino Virgillito
>            Assignee: Maurizio Cucchiara
>             Fix For: 2.3.x
>
>         Attachments: checkboxlist.ftl, checkboxlist.ftl, multivalueTest.zip
>
>
> 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. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (WW-3584) convertToString in custom StrutsTypeConverter not called for multiple-valued tags (checkboxlist and select)

Posted by "Antonino Virgillito (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WW-3584?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Antonino Virgillito updated WW-3584:
------------------------------------

    Attachment:     (was: multivalueTest.zip)

> convertToString in custom StrutsTypeConverter not called for multiple-valued tags (checkboxlist and select)
> -----------------------------------------------------------------------------------------------------------
>
>                 Key: WW-3584
>                 URL: https://issues.apache.org/jira/browse/WW-3584
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Core Actions
>    Affects Versions: 2.2.1.1
>            Reporter: Antonino Virgillito
>            Assignee: Maurizio Cucchiara
>
> 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. 

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (WW-3584) convertToString in custom StrutsTypeConverter not called for multiple-valued tags (checkboxlist and select)

Posted by "Rene Gielen (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WW-3584?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Rene Gielen updated WW-3584:
----------------------------

    Summary: convertToString in custom StrutsTypeConverter not called for multiple-valued tags (checkboxlist and select)  (was: 2)
    
> convertToString in custom StrutsTypeConverter not called for multiple-valued tags (checkboxlist and select)
> -----------------------------------------------------------------------------------------------------------
>
>                 Key: WW-3584
>                 URL: https://issues.apache.org/jira/browse/WW-3584
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Core Actions
>    Affects Versions: 2.2.1.1
>            Reporter: Antonino Virgillito
>            Assignee: Maurizio Cucchiara
>             Fix For: 2.3.x
>
>         Attachments: checkboxlist.ftl, multivalueTest.zip
>
>
> 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. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Issue Comment Edited] (WW-3584) convertToString in custom StrutsTypeConverter not called for multiple-valued tags (checkboxlist and select)

Posted by "sebastien b. (Issue Comment Edited) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WW-3584?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13234216#comment-13234216 ] 

sebastien b. edited comment on WW-3584 at 3/21/12 9:23 AM:
-----------------------------------------------------------

The bug is solved for me with the checkboxlist.ftl file corrected.

I modified only this file to add the css render.

Thanks !
CCordially.
                
      was (Author: sebmatrix):
    The bug is solved for me with the checkboxlist.ftl file corrected.

I modified this file only to add the css render.

Thanks !
CCordially.
                  
> convertToString in custom StrutsTypeConverter not called for multiple-valued tags (checkboxlist and select)
> -----------------------------------------------------------------------------------------------------------
>
>                 Key: WW-3584
>                 URL: https://issues.apache.org/jira/browse/WW-3584
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Core Actions
>    Affects Versions: 2.2.1.1
>            Reporter: Antonino Virgillito
>            Assignee: Maurizio Cucchiara
>             Fix For: 2.3.x
>
>         Attachments: checkboxlist.ftl, checkboxlist.ftl, multivalueTest.zip
>
>
> 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. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (WW-3584) convertToString in custom StrutsTypeConverter not called for multiple-valued tags (checkboxlist and select)

Posted by "Maurizio Cucchiara (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WW-3584?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13006002#comment-13006002 ] 

Maurizio Cucchiara commented on WW-3584:
----------------------------------------

Hi Antonio,
I don't know what happens to the attached zip, but I cannot open it neither with my ubuntu or my android. 

> convertToString in custom StrutsTypeConverter not called for multiple-valued tags (checkboxlist and select)
> -----------------------------------------------------------------------------------------------------------
>
>                 Key: WW-3584
>                 URL: https://issues.apache.org/jira/browse/WW-3584
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Core Actions
>    Affects Versions: 2.2.1.1
>            Reporter: Antonino Virgillito
>            Assignee: Maurizio Cucchiara
>         Attachments: multivalueTest.zip
>
>
> 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. 

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] Updated: (WW-3584) convertToString in custom StrutsTypeConverter not called for multiple-valued tags (checkboxlist and select)

Posted by "Antonino Virgillito (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WW-3584?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Antonino Virgillito updated WW-3584:
------------------------------------

    Attachment: multivalueTest.zip

Here are the test files showing the issue. 

The zip contains: 
- bean class 
- action class
- conversion class (with configuration file)
- JSP file (form and checkboxlist)
- struts configuration

Some annotations:
- The conversion class containts prints for tracing the methods execution
- The JSP contains a commented textfield tag having the same name as the checkboxlist. When uncommenting the tag  convertToString is called. 
- If you change the name to colorStringValue the checkbox is populated (colorStringValue is a list of strings)

> convertToString in custom StrutsTypeConverter not called for multiple-valued tags (checkboxlist and select)
> -----------------------------------------------------------------------------------------------------------
>
>                 Key: WW-3584
>                 URL: https://issues.apache.org/jira/browse/WW-3584
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Core Actions
>    Affects Versions: 2.2.1.1
>            Reporter: Antonino Virgillito
>            Assignee: Maurizio Cucchiara
>         Attachments: multivalueTest.zip
>
>
> 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. 

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (WW-3584) convertToString in custom StrutsTypeConverter not called for multiple-valued tags (checkboxlist and select)

Posted by "Christian Grobmeier (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WW-3584?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13042895#comment-13042895 ] 

Christian Grobmeier commented on WW-3584:
-----------------------------------------

I am not sure if I am running in the same bug.

I have two fields in my action. One is filled with a checkbox value, one not.
Now I wrote two custom type converters. The one for the int value (non-checkbox) is working,
the one for the boolean value (checkbox) is not working.

Struts did reckognize both of my Converters, as I could see in the log file. But just the first one is actually executed, even when the second one seems to have an object:

2011-06-02 19:12:37,962 DEBUG [CommonsLogger.java:57] : taskId:de.UnsignedIntegerConverter@7057323f
2011-06-02 19:12:37,962 DEBUG [CommonsLogger.java:57] : endOfDay:de.CheckboxToBooleanConverter@771b821f

MyAction-conversion.properties:

taskId = de.UnsignedIntegerConverter
endOfDay = de.CheckboxToBooleanConverter

taskId works as expected.

I even have tried this:

@TypeConversion(converter = "de.CheckboxToBooleanConverter")
public void setEndOFDay(boolean endOFDay) {

But still no execution.


> convertToString in custom StrutsTypeConverter not called for multiple-valued tags (checkboxlist and select)
> -----------------------------------------------------------------------------------------------------------
>
>                 Key: WW-3584
>                 URL: https://issues.apache.org/jira/browse/WW-3584
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Core Actions
>    Affects Versions: 2.2.1.1
>            Reporter: Antonino Virgillito
>            Assignee: Maurizio Cucchiara
>         Attachments: multivalueTest.zip
>
>
> 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. 

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (WW-3584) convertToString in custom StrutsTypeConverter not called for multiple-valued tags (checkboxlist and select)

Posted by "Antonino Virgillito (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WW-3584?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13010614#comment-13010614 ] 

Antonino Virgillito commented on WW-3584:
-----------------------------------------

Maurizio, I attached the zip again. I have checked and now it should be fine. 

> convertToString in custom StrutsTypeConverter not called for multiple-valued tags (checkboxlist and select)
> -----------------------------------------------------------------------------------------------------------
>
>                 Key: WW-3584
>                 URL: https://issues.apache.org/jira/browse/WW-3584
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Core Actions
>    Affects Versions: 2.2.1.1
>            Reporter: Antonino Virgillito
>            Assignee: Maurizio Cucchiara
>         Attachments: multivalueTest.zip
>
>
> 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. 

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (WW-3584) convertToString in custom StrutsTypeConverter not called for multiple-valued tags (checkboxlist and select)

Posted by "Maurizio Cucchiara (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WW-3584?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13088235#comment-13088235 ] 

Maurizio Cucchiara commented on WW-3584:
----------------------------------------

I removed the link to XW-297, which I suppose is related with the behavior depicted by Alfredo.

> convertToString in custom StrutsTypeConverter not called for multiple-valued tags (checkboxlist and select)
> -----------------------------------------------------------------------------------------------------------
>
>                 Key: WW-3584
>                 URL: https://issues.apache.org/jira/browse/WW-3584
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Core Actions
>    Affects Versions: 2.2.1.1
>            Reporter: Antonino Virgillito
>            Assignee: Maurizio Cucchiara
>         Attachments: multivalueTest.zip
>
>
> 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. 

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Issue Comment Edited: (WW-3584) convertToString in custom StrutsTypeConverter not called for multiple-valued tags (checkboxlist and select)

Posted by "Antonino Virgillito (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WW-3584?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13005694#comment-13005694 ] 

Antonino Virgillito edited comment on WW-3584 at 3/11/11 4:09 PM:
------------------------------------------------------------------

Here are the test files showing the issue. 

The zip contains: 
- bean class 
- action class
- conversion class (with configuration file)
- JSP file (form and checkboxlist)
- struts configuration

Some annotations:
- The conversion class containts prints for tracing the methods execution
- The JSP contains a commented textfield tag having the same name as the checkboxlist. When uncommenting the tag  convertToString is called. 
- If you change the name of checkboxlist to colorStringValue the checkbox is populated (colorStringValue is a list of strings)

      was (Author: virgillito):
    Here are the test files showing the issue. 

The zip contains: 
- bean class 
- action class
- conversion class (with configuration file)
- JSP file (form and checkboxlist)
- struts configuration

Some annotations:
- The conversion class containts prints for tracing the methods execution
- The JSP contains a commented textfield tag having the same name as the checkboxlist. When uncommenting the tag  convertToString is called. 
- If you change the name to colorStringValue the checkbox is populated (colorStringValue is a list of strings)
  
> convertToString in custom StrutsTypeConverter not called for multiple-valued tags (checkboxlist and select)
> -----------------------------------------------------------------------------------------------------------
>
>                 Key: WW-3584
>                 URL: https://issues.apache.org/jira/browse/WW-3584
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Core Actions
>    Affects Versions: 2.2.1.1
>            Reporter: Antonino Virgillito
>            Assignee: Maurizio Cucchiara
>         Attachments: multivalueTest.zip
>
>
> 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. 

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] Commented: (WW-3584) convertToString in custom StrutsTypeConverter not called for multiple-valued tags (checkboxlist and select)

Posted by "Maurizio Cucchiara (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WW-3584?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13005465#comment-13005465 ] 

Maurizio Cucchiara commented on WW-3584:
----------------------------------------

According with what Antonino said, the tag textfield works as expected, so I deduce that you're talking about some different behaviour.

> convertToString in custom StrutsTypeConverter not called for multiple-valued tags (checkboxlist and select)
> -----------------------------------------------------------------------------------------------------------
>
>                 Key: WW-3584
>                 URL: https://issues.apache.org/jira/browse/WW-3584
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Core Actions
>    Affects Versions: 2.2.1.1
>            Reporter: Antonino Virgillito
>            Assignee: Maurizio Cucchiara
>
> 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. 

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira