SummaryRow/HeaderRow: conflict with PanelGridBodyColumnRenderer
See original GitHub issueDescribe the defect
When <p:dataTable><p:summaryRow><p:column>
is nested in <p:panelGrid><p:row><p:column>
then the ColumnRenderer
of <p:summaryRow><p:column>
incorrectly delegates to PanelGridBodyColumnRenderer
as “helper renderer”, causing a rendering of a double-nested <td>
element.
Reproducer
<p:panelGrid>
<p:row>
<p:column>
<p:dataTable id="table" value="#{[
{'id':1,'group':'odd'},
{'id':3,'group':'odd'},
{'id':5,'group':'odd'},
{'id':2,'group':'even'},
{'id':4,'group':'even'}
]}" var="item" sortBy="#{item.group}">
<p:column headerText="id">
#{item.id}
</p:column>
<p:column headerText="group">
#{item.group}
</p:column>
<p:summaryRow>
<p:column>
#{item.group} ids
</p:column>
<p:column>
#{item.group} summary
</p:column>
</p:summaryRow>
</p:dataTable>
</p:column>
</p:row>
</p:panelGrid>
Environment:
- PF Version: 8.0
- JSF + version: Mojarra 2.3.15
- Affected browsers: ALL
To Reproduce Steps to reproduce the behavior:
- Copy paste above XHTML snippet into
<h:body>
of empty template (no bean needed) - Open page in webbrowser
- Observe following output (Chrome)
Expected behavior
No double-nested <td>
cells in summary row
Work around
Remove Constants.HELPER_RENDERER
attribute from context. This can be achieved by editing the example XHTML as follows
<p:summaryRow listener="#{facesContext.attributes.remove('org.primefaces.HELPER_RENDERER')}">
Solution
Probably in SummaryRowRenderer#encodeXxx()
. Remove that attribute, render, then put back that attribute.
Issue Analytics
- State:
- Created 2 years ago
- Comments:14 (9 by maintainers)
Top Results From Across the Web
No results found
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yeah we have about 300+ tests so far and growing as we add scenarios. Runs against Mojarra and Myfaces. And against Firefox, Chrome, and Safari.
OK I updated my PR. I had to do the same fix in HeaderRow if you are using both a Summary Row and and Header Row. Now its all working.