myfaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paul Nicolucci (JIRA)" <...@myfaces.apache.org>
Subject [jira] [Commented] (MYFACES-3749) columnClasses not working correctly in DataTable Component
Date Mon, 12 Aug 2013 19:59:47 GMT

    [ https://issues.apache.org/jira/browse/MYFACES-3749?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13737288#comment-13737288
] 

Paul Nicolucci commented on MYFACES-3749:
-----------------------------------------

I talked with Leonardo about this on the dev mailing list and he replied with the following:

Here is what it says the renderkit javadoc for javax.faces.Table:

"... Output a "tr" element. Output the value of the "rowClasses" per
the attribute description below. For each UIColumn child, if the
column component has a "rowHeader" attribute with a value of
"true", output a "th" element with a "scope" attribute with the value
of "row". Otherwise, if the column component has no "rowHeader"
attribute, or its value is false, output a "td" element. In either case
attach the value of the "columnClasses" attribute of the UIData
component per the attribute description below. Recursively encode
each child of each UIColumn child. Close out the "td" or "th"
element. When done with the row, close out the "tr" element.
When done with all the rows, close out the "tbody" element. ..."

I think the javadoc support the change proposed. It is clear it says
"For each UIColumn child...", so "columnClasses" should only
apply to UIColumn instances.
                
> columnClasses not working correctly in DataTable Component
> ----------------------------------------------------------
>
>                 Key: MYFACES-3749
>                 URL: https://issues.apache.org/jira/browse/MYFACES-3749
>             Project: MyFaces Core
>          Issue Type: Bug
>          Components: JSR-314
>    Affects Versions: 2.0.18, 2.1.12
>            Reporter: Paul Nicolucci
>
> Sample JSF page:
> <h:outputStylesheet library="css" name="table-style.css"  />
> <h:dataTable value="#{dataTableBean.sampleList}" var="o"
> styleClass="order-table"
> headerClass="order-table-header"
> rowClasses="order-table-odd-row,order-table-even-row"
> columnClasses="col0,col1,col2,col3"
> >
> <f:param id="testParam" value="TESTER" />
>             
> <h:column>
> <f:facet name="header">Column1</f:facet>
> #{o.str1}
> </h:column>
>     
> <h:column>
> <f:facet name="header">Column2</f:facet>
> #{o.str2}
> </h:column>
>     
> <h:column>
> <f:facet name="header">Column3</f:facet>
> #{o.str3}
> </h:column>
>     
> <h:column>
> <f:facet name="header">Column4</f:facet>
> #{o.str4}
> </h:column>
> </h:dataTable>  
> Sample CSS:
> .order-table{   
> border-collapse:collapse;
> }
> .order-table-header{
> text-align:center;
> }
> .order-table-odd-row{
> text-align:center;
> }
> .order-table-even-row{
> text-align:center;
> }
> .col0{
> text-align:center;
> }
> .col1{
> text-align:center;
> }
> .col2{
> text-align:center;
> }
> .col3{
> text-align:center;
> }
> Problem description:
> The rendered output of one of the rows of the above page is the following:
> <tr class="order-table-odd-row"><td class="col1">
> test1
> </td><td class="col2">
> test2
> </td><td class="col3">
> test3
> </td><td class="">
> test4
> </td></tr>
> As you can see the last column has no definition of a columnClass ( class="" ).   The
same page works if we remove the <f:param/> definition from within the 
> <h:dataTable/>.  If the f:param tag is removed then I see that all of the columns
have a defined class as expected ( the number of columns is less than or equal to the 
> defined columnClasses so each of the columns should have a class defined. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message