Uploaded image for project: 'MyFaces Trinidad'
  1. MyFaces Trinidad
  2. TRINIDAD-520

CLASSCASTEXCEPTION WHEN USING NON-STRING LABEL VALUE IN AF:SELECTITEM

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Trivial
    • Resolution: Fixed
    • 1.0.0-incubating-core
    • 1.0.0-incubating-core
    • None
    • None

    Description

      I have the following:

      <af:selectOneChoice value="#

      {searchEmployees.criteria.EmployeesJobId}

      "
      >

      <af:forEach var="row2" items="#

      {bindings.JobsViewLookup.rangeSet}

      " >
      <af:selectItem label="#

      {row2.JobId}" value="#{row2.JobId}

      "/>
      </af:forEach>

      </af:selectOneChoice>

      however, #

      {row2.JobId}

      (on the label attribute) evaluates to a java.lang.Number and this throws a ClassCastException, since the attribute expects a String.

      trivial fix is to use
      String foo = label.toString()
      instead of
      String foo = (String) label

      I have a fix already.

      Attachments

        1. fix_cce_in_selectItemSupport.patch
          0.7 kB
          Arjuna Wijeyekoon

        Activity

          People

            matzew Matthias Wessendorf
            arjuna Arjuna Wijeyekoon
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: