开发者

How do I get the scope attribute on my table headers when using MyFaces 1.1?

开发者 https://www.devze.com 2022-12-09 01:42 出处:网络
I\'m using MyFaces 1.1.7 with Facelets and Tomahawk. When creating a regular data table, like: <h:dataTable value = \"#{Datamanager.data}\" var = \"row\">

I'm using MyFaces 1.1.7 with Facelets and Tomahawk.

When creating a regular data table, like:

<h:dataTable value = "#{Datamanager.data}" var = "row">
   <h:column>
        <f:facet name = "header">
            <t:div>
                <h:outputText value = "Name" />
            </t:div>
        </f:facet>
        <h:outputText value = "#{row}" />
    </h:column>
</h:dataTable>

I get a HTML generated table with a header like:

<table>

 <thead>
  <tr>
   <th>
    <div id="j_id4:j_id6">Name</div>
   </th>
  </tr>
 </thead>

 <tbody id="j_id4:tbody_element">
  <tr><td>First</td></tr>
  <tr><td>Second</td></tr>
 </tbody>
</table>

However, to conform with WAI validation I would love to have the "scope" attribute on that header (even when the scope is only 1 column). Does anyone know how to add it (either by having MyFaces add it by default, or by adding an extra attribute) so that I get a header like:

 <thead>
  <tr>
   <th scope="开发者_如何学Pythoncol">
    <div id="j_id4:j_id6">Name</div>
   </th>
  </tr>
 </thead>

I have tried using like:

<f:facet name = "header">
    <f:attribute name="scope" value="col" />
<h:outputText value = "Name" />
</f:facet>

with no success.

Thanks!


This seems to have been fixed in MyFaces 1.2

0

精彩评论

暂无评论...
验证码 换一张
取 消