javaserverfaces
  1. javaserverfaces
  2. JAVASERVERFACES-2465

f:passThroughAttribute & f:passThroughAttributes adding attributes to both parent and all children

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: facelets
    • Labels:
      None
    • Environment:

      n/a

      Description

      I am unsure if this is expected behavior or not, so I am filing this issue.

      According to the TLD doc it states the following:

      passThroughAttribute:
      "Add an attribute to the passThroughAttributes Map of the UIComponent associated with the closest parent UIComponent tag."

      Based on that I have a page that looks similar to the below.

      ------------------------------------ start page snippet

      <h:selectOneMenu id="menu1" p:foo="bar" >

      <f:selectItem id="menu1Item1"
      itemLabel="foo"
      itemValue="true" />
      <f:selectItem id="menu1Item2"
      itemLabel="bar"
      itemValue="false" />

      <f:passThroughAttribute name="singleatt" value="singleAtt" />
      <f:passThroughAttributes value="#

      {Attribute.attMap}

      " />
      </h:selectOneMenu>

      ------------------------------------ end page snippet

      Based on the above this is what renders.

      ------------------------------------ start render snippet

      <select id="menu1" name="menu1" singleatt="singleAtt" foo="bar" manyatttwo="manyTwo" manyattone="manyOne" manyattthree="manyThree">
      <option value="true" singleatt="singleAtt" foo="bar" manyatttwo="manyTwo" manyattone="manyOne" manyattthree="manyThree">foo</option>
      <option value="false" singleatt="singleAtt" foo="bar" manyatttwo="manyTwo" manyattone="manyOne" manyattthree="manyThree">bar</option>
      </select>

      ------------------------------------ end render snippet

      So based on what the TLD states I would think that the passthrough attributes being either the "p:", or the f:passThroughAttribute(s) tags usage in the above example, we should only see the passthough attributes being placed on the <select> tag and not on either of the <option> tags.

        Activity

        Hide
        dougd added a comment -

        Here is the rendered output for h:datatable, as another point of reference to this issue, it is not just happening to the h:selectOne... tags.

        <table id="data1" singleatt="singleAtt" foo="bar" manyatttwo="manyTwo" manyattone="manyOne" manyattthree="manyThree">
        <tbody singleatt="singleAtt" foo="bar" manyatttwo="manyTwo" manyattone="manyOne" manyattthree="manyThree">
        <tr singleatt="singleAtt" foo="bar" manyatttwo="manyTwo" manyattone="manyOne" manyattthree="manyThree">
        <td>Anna</td>
        <td>f</td>
        <td>28</td>
        </tr>
        <tr singleatt="singleAtt" foo="bar" manyatttwo="manyTwo" manyattone="manyOne" manyattthree="manyThree">
        <td>Cort</td>
        <td>m</td>
        <td>7</td>
        </tr>
        <tr singleatt="singleAtt" foo="bar" manyatttwo="manyTwo" manyattone="manyOne" manyattthree="manyThree">
        <td>Cade</td>
        <td>m</td>
        <td>4</td>
        </tr>
        </tbody>
        </table>

        Show
        dougd added a comment - Here is the rendered output for h:datatable, as another point of reference to this issue, it is not just happening to the h:selectOne... tags. <table id="data1" singleatt="singleAtt" foo="bar" manyatttwo="manyTwo" manyattone="manyOne" manyattthree="manyThree"> <tbody singleatt="singleAtt" foo="bar" manyatttwo="manyTwo" manyattone="manyOne" manyattthree="manyThree"> <tr singleatt="singleAtt" foo="bar" manyatttwo="manyTwo" manyattone="manyOne" manyattthree="manyThree"> <td>Anna</td> <td>f</td> <td>28</td> </tr> <tr singleatt="singleAtt" foo="bar" manyatttwo="manyTwo" manyattone="manyOne" manyattthree="manyThree"> <td>Cort</td> <td>m</td> <td>7</td> </tr> <tr singleatt="singleAtt" foo="bar" manyatttwo="manyTwo" manyattone="manyOne" manyattthree="manyThree"> <td>Cade</td> <td>m</td> <td>4</td> </tr> </tbody> </table>
        Hide
        dougd added a comment -

        This is no longer and issue

        Show
        dougd added a comment - This is no longer and issue

          People

          • Assignee:
            Ed Burns
            Reporter:
            dougd
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: