javaserverfaces
  1. javaserverfaces
  2. JAVASERVERFACES-2753

h:selectManyCheckbox does not respect attribute "collectionType"

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Cannot Reproduce
    • Affects Version/s: 2.1.0, 2.1.20
    • Fix Version/s: 2.2.3
    • Component/s: None
    • Labels:
      None

      Description

      The attribute "collectionType" of h:selectManyCheckbox is not respected.

      I have the following xhtml snippet:

       
      <h:selectManyCheckbox
          value="#{backingBean.values['type']}"
          collectionType="java.util.ArrayList"
          converter="#{myCustomConverter}>
          <f:selectItems .../>
      </h:selectManyCheckbox>
      

      The bean has a map of the following type:
      Map<Type, ArrayList<MyItem>>

      The checkboxes are display correctly, and the converter is used correctly in both directions.

      Unfortunately when I try to access the values of the map after submitting the page, the map does not hold lists anymore. Instead I get a ClassCastException, because the values have been replaced by an Object[].

      I use Mojarra 2.1.0, but related code in MenuRender, which I think is the relevant code, did not change in later versions.

        Activity

        Hide
        Manfred Riem added a comment -

        Can you verify if this is still a problem in the latest 2.1 release?

        Show
        Manfred Riem added a comment - Can you verify if this is still a problem in the latest 2.1 release?
        Hide
        DKaminsky added a comment -

        Hello Manfred,

        yes, I can confirm this problem using version Mojarra 2.1.20 ( 20130304-1520 https://svn.java.net/svn/mojarra~svn/tags/2.1.20@11693).
        A simple minimal example can be found here:
        https://issues.apache.org/jira/browse/MYFACES-3522

        MyFaces suffered from the same issue.

        Regards,

        Daniel

        Show
        DKaminsky added a comment - Hello Manfred, yes, I can confirm this problem using version Mojarra 2.1.20 ( 20130304-1520 https://svn.java.net/svn/mojarra~svn/tags/2.1.20@11693 ). A simple minimal example can be found here: https://issues.apache.org/jira/browse/MYFACES-3522 MyFaces suffered from the same issue. Regards, Daniel
        Hide
        Manfred Riem added a comment -

        I verified with 2.2.3 and I am unable to reproduce this.

        Show
        Manfred Riem added a comment - I verified with 2.2.3 and I am unable to reproduce this.

          People

          • Assignee:
            Manfred Riem
            Reporter:
            DKaminsky
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: