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

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.0.0-beta-2
    • 2.0.0
    • JSR-314
    • None
    • 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

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

            Dates

              Created:
              Updated:
              Resolved: