TreeTable component inside ui:repeat miscalculates header

UI Components for JSF
Post Reply
dev.subscriptions
Posts: 1
Joined: 28 Feb 2017, 06:21

27 Jun 2017, 00:04

Hello,

We are trying to use a tree table component embedded inside a ui:repeat tag. The behavior we see is that the header information of the first tree table is used to draw the subsequent occurrences.

For example if treetable1 has 5 columns, with headers table1col1, table1col2, table1col3,table1col4 and table1col5

and treetable2 has 3 columns with headers table2col1,table2col2 and table2col3

When rendered it shows table2 incorrectly as

table2col1,table2col2,table2col3,table1col4,table1col5

In case table 1 has lesser columns than table two, then the tree table truncates and does not show any of the extra columns that belong to table 2.

I am attaching samples of xhtml code that shows the actual erroneous behavior.

XHTML page with ui repeat.

<!DOCTYPE html>
<html xmlns="http://www.w3c.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:p="http://primefaces.org/ui"
xmlns:f="http://xmlns.jcp.org/jsf/core"
xmlns:ui="http://xmlns.jcp.org/jsf/facelets">
<h:head>
</h:head>

<h:body>

<h:form id="form">

<ui:repeat value="#{treeTableTest.uiRepeat}" var="uiRepeatVar">
<ui:include src="treetable.xhtml">
<ui:param name="propertyParam" value="#{uiRepeatVar}" />
</ui:include>
</ui:repeat>

</h:form>

</h:body>
</html>


Embeded page with ui:include from above.

<ui:fragment xmlns="http://www.w3c.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:p="http://primefaces.org/ui"
xmlns:f="http://xmlns.jcp.org/jsf/core"
xmlns:ui="http://xmlns.jcp.org/jsf/facelets">

<h:panelGroup layout="block">

<p:treeTable id="tt" value="#{propertyParam}" var="tableRow">
<f:facet name="header">
TreeTable TEST
</f:facet>
<p:columns value="#{treeTableTest.getColumnsByTable(propertyParam)}" var="column"
headerText="#{column.header}">
<h:outputText value="#{tableRow[column.property]}" />
</p:columns>
</p:treeTable>

</h:panelGroup>

</ui:fragment>

Anybody know if this is a bug that is already being worked on or if this is a usage error that we cannot seem to understand.

Appreciate any response.

Regards
AM
Primefaces: 6.1.2
Tomcat: 8.5
MyFaces: 2.2.9

kukeltje
Expert Member
Posts: 9605
Joined: 17 Jun 2010, 13:34
Location: Netherlands

29 Jun 2017, 13:06

Try using a p:repeat

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 44 guests