Im facing a problem with datatable inside composites which my datatable does not page, maybe its related to: issue 2349. Its a known issue?
heres some code:
composite
Code: Select all
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:p="http://primefaces.org/ui"
xmlns:composite="http://java.sun.com/jsf/composite">
<composite:interface>
</composite:interface>
<composite:implementation>
<composite:insertChildren />
</composite:implementation>
</html>
Code: Select all
@ManagedBean
@ViewScoped
public class TestMB implements Serializable{
private List<String> cars;
@PostConstruct
public void init() {
cars = new ArrayList<String>();
for (int i = 0; i < 30; i++) {
cars.add("car " + i);
}
}
//getters & setters
}
Code: Select all
<p:panel>
<cc:test>
<p:dataTable rows="5" paginatorPosition="bottom" //this table doesnt page
value="#{testMB.cars}"
id="table" var="row"
paginator="true" paginatorTemplate="{CurrentPageReport}
{FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink}
{LastPageLink} {RowsPerPageDropdown}"
rowsPerPageTemplate="5,10,15,20,30">
<p:column headerText="Car">
<h:outputText value="#{row}"/>
</p:column>
</p:dataTable>
</cc:test>
<p:dataTable rows="5" paginatorPosition="bottom" //this datatable outside composite works
value="#{testMB.cars}"
id="table" var="row"
paginator="true" paginatorTemplate="{CurrentPageReport}
{FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink}
{LastPageLink} {RowsPerPageDropdown}"
rowsPerPageTemplate="5,10,15,20,30">
<p:column headerText="Car">
<h:outputText value="#{row}"/>
</p:column>
</p:dataTable>
</p:panel>
and heres the image with the second datatable working cause its outside the composite:
edit: i got no errors and here is the firebug output when i try to go to second page:
Code: Select all
<?xml version='1.0' encoding='UTF-8'?>
<partial-response><changes><update id="mainForm:j_idt57:table"><![CDATA[<tbody id="mainForm:j_idt57:table_data" class="ui-datatable-data ui-widget-content"><tr id="mainForm:j_idt57:table_r_0" class="ui-widget-content ui-datatable-even"><td><div class="ui-dt-c">car 0</div></td></tr><tr id="mainForm:j_idt57:table_r_1" class="ui-widget-content ui-datatable-odd"><td><div class="ui-dt-c">car 1</div></td></tr><tr id="mainForm:j_idt57:table_r_2" class="ui-widget-content ui-datatable-even"><td><div class="ui-dt-c">car 2</div></td></tr><tr id="mainForm:j_idt57:table_r_3" class="ui-widget-content ui-datatable-odd"><td><div class="ui-dt-c">car 3</div></td></tr><tr id="mainForm:j_idt57:table_r_4" class="ui-widget-content ui-datatable-even"><td><div class="ui-dt-c">car 4</div></td></tr></tbody>]]></update><update id="javax.faces.ViewState"><![CDATA[-6465088529067896649:-8308165990198594565]]></update></changes></partial-response>
Code: Select all
<?xml version='1.0' encoding='UTF-8'?>
<partial-response><changes><update id="mainForm:table"><![CDATA[<tbody id="mainForm:table_data" class="ui-datatable-data ui-widget-content"><tr id="mainForm:table_r_5" class="ui-widget-content ui-datatable-odd"><td><div class="ui-dt-c">car 5</div></td></tr><tr id="mainForm:table_r_6" class="ui-widget-content ui-datatable-even"><td><div class="ui-dt-c">car 6</div></td></tr><tr id="mainForm:table_r_7" class="ui-widget-content ui-datatable-odd"><td><div class="ui-dt-c">car 7</div></td></tr><tr id="mainForm:table_r_8" class="ui-widget-content ui-datatable-even"><td><div class="ui-dt-c">car 8</div></td></tr><tr id="mainForm:table_r_9" class="ui-widget-content ui-datatable-odd"><td><div class="ui-dt-c">car 9</div></td></tr></tbody>]]></update><update id="javax.faces.ViewState"><![CDATA[-6465088529067896649:-8308165990198594565]]></update></changes></partial-response>