Uploaded image for project: 'MyFaces Core'
  1. MyFaces Core
  2. MYFACES-2546

Conversion rules for obtaing renderable String from the "value" property of SelectItem

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.0.0-beta-2
    • Fix Version/s: 2.0.0
    • Component/s: JSR-314
    • Labels:
      None
    • Environment:
      myfaces trunk

      Description

      <h:selectOneMenu>
      <f:selectItems value="#

      {model.selectItemsWithNonStringValue}

      " />
      </h:selectOneMenu>

      if SelectItem.getValue() returns other type than String and there is no converter for that type, myfaces throw exception: java.lang.IllegalArgumentException: Value is no String
      at org.apache.myfaces.shared_impl.renderkit.RendererUtils.getConvertedStringValue(RendererUtils.java:633)
      at org.apache.myfaces.shared_impl.renderkit.RendererUtils.getConvertedStringValue(RendererUtils.java:652)
      at org.apache.myfaces.shared_impl.renderkit.html.HtmlRendererUtils.renderSelectOptions(HtmlRendererUtils.java:538)

      RI does not throw a exception but with quietness outputs toString() as <option> value.

        Attachments

        1. MYFACES-2546.patch
          0.9 kB
          Martin Kočí

          Activity

            People

            • Assignee:
              lu4242 Leonardo Uribe
              Reporter:
              markoc50 Martin Kočí
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: