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

Passthrough attributes for f:selectItem and f:selectItems should be rendered by associated components

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 2.2.4
    • JSR-344
    • None

    Description

      Reported by Sebastian Mellmann:

      Hello everyone,

      I have just run into a problem where the 'title' attribut is not being rendered using the <h:selectOneMenu> tag.

      Used version is MyFaces Core 2.2.2

      I had a look into the source code and the following changes seem to fix the problem:

      Class: org.apache.myfaces.shared.renderkit.html.HtmlRendererUtils

      Method: renderSelectOptions (Line 521)

      Code changes listed on pastebin: http://pastebin.com/SHLKxi5H

      Can someone confirm this, because I wanted to ask the ML first before opening an issue via Apache JIRA for MyFaces?!

      Thanks and regards,

      Sebastian

      The problem is not the title fix, is that passthrough attributes must work for components created by effect of f:selectItem and f:selectItems. There is a line in the renderkit javadoc of javax.faces.SelectMany/javax.faces.Listbox that says:

      "... In both the case of the "option" element or the "optgroup"
      element, the implementation must pass the UISelectItem or
      UISelectItems corresponding to the SelectItem bean to the call to
      ResponseWriter.startElement(). ..."

      I tested against Mojarra 2.2.6 and it is correct. But Mojarra has a bug in this part, because components like h:selectManyCheckbox or h:selectOneRadio should work just the same, but in this case a set of "input" html tags are rendered instead. It is clear the renderkit javadoc reference how the "option" is rendered, so we should follow the spirit of the spec in this part, which is allow to define passthrough attributes for f:selectItem and f:selectItems.

      Attachments

        Activity

          People

            lu4242 Leonardo Uribe
            lu4242 Leonardo Uribe
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: