MyFaces Core
  1. MyFaces Core
  2. MYFACES-3522

collectionType attribute of selectManyCheckbox not processed correctly

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 2.1.6
    • Fix Version/s: 2.0.13, 2.1.7
    • Component/s: None
    • Labels:
      None
    • Environment:
      Tomcat 6.0.35
      myFaces 2.1.6

      Description

      The collectionType attribute of h:selectManyCheckbox is not processed correctly.

      The value attribute of selectManyCheckbox points to a Map with an ArrayList containing Strings as values, representing the selected values.
      The checkboxes are initially correctly checked, but after ajax submission the model (Map<Sting,Object) contains StringArrays instead of ArrayLists.
      This worked well since JSF 1.0, but it does not work with 2.1 anymore.
      It can be easily reproduced with MyFaces only.
      I see this as critical because ClassCastException are thrown as a result in application code.

      1. z.war
        3 kB
        Michael Heinen

        Activity

        Hide
        Michael Heinen added a comment -

        Sample webApp.
        Call <context>faces/mypage.xhtml

        Show
        Michael Heinen added a comment - Sample webApp. Call <context>faces/mypage.xhtml
        Hide
        Leonardo Uribe added a comment -

        Thanks Michael for the example. In this case, the solution is just move the code that check for collectionType to the outer block. In that way the check for collectionType is done in the right place. Note in the example valueType property has no effect, because that is a tomahawk specific property.

        Show
        Leonardo Uribe added a comment - Thanks Michael for the example. In this case, the solution is just move the code that check for collectionType to the outer block. In that way the check for collectionType is done in the right place. Note in the example valueType property has no effect, because that is a tomahawk specific property.
        Hide
        Michael Heinen added a comment -

        Thanks for the quick fix Leonardo!!!

        Is it fixed for myfaces and for tomahawk selectManyCheckbox?
        I just saw two checkins for trunk and branch 2.0 but there are two different _SharedRendererUtils implementation, or?
        javax.faces.component._SharedRendererUtils and org.apache.myfaces.shared_tomahawk.renderkit_SharedRendererUtils

        Show
        Michael Heinen added a comment - Thanks for the quick fix Leonardo!!! Is it fixed for myfaces and for tomahawk selectManyCheckbox? I just saw two checkins for trunk and branch 2.0 but there are two different _SharedRendererUtils implementation, or? javax.faces.component._SharedRendererUtils and org.apache.myfaces.shared_tomahawk.renderkit_SharedRendererUtils
        Hide
        Leonardo Uribe added a comment -

        Once is fixed in shared, it is fixed in tomahawk too. It seems I forgot to synch javax.faces.component._SharedRendererUtils, but for the issue mentioned it is not necessary. Anyway, I updated the code in trunk. Thanks for remember me that.

        Show
        Leonardo Uribe added a comment - Once is fixed in shared, it is fixed in tomahawk too. It seems I forgot to synch javax.faces.component._SharedRendererUtils, but for the issue mentioned it is not necessary. Anyway, I updated the code in trunk. Thanks for remember me that.

          People

          • Assignee:
            Leonardo Uribe
            Reporter:
            Michael Heinen
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development