Datatable inside composite component does not page

UI Components for JSF
Post Reply
User avatar
kwintesencja
Posts: 316
Joined: 08 Feb 2010, 20:33
Location: Brazil

05 Nov 2011, 13:01

Hi everyone,

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>
mbean

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
}
xhtml

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:

Image

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>
and here is the response for the second datatable:

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>
Att,

--

Rafael Mauricio Pestano


Primefaces 5.x + JavaEE7(Glassfish 4.x and Wildfly 8)
Conventions Framework
Blog
@realpestano

maiconramones
Posts: 1
Joined: 23 Sep 2010, 16:15

07 Nov 2011, 18:55

Hi guys, I have the same problem.

I would like know if someone solved this problem.

User avatar
kwintesencja
Posts: 316
Joined: 08 Feb 2010, 20:33
Location: Brazil

09 Nov 2011, 18:42

Att,

--

Rafael Mauricio Pestano


Primefaces 5.x + JavaEE7(Glassfish 4.x and Wildfly 8)
Conventions Framework
Blog
@realpestano

mouse
Posts: 24
Joined: 23 Jun 2010, 23:38

10 Nov 2011, 00:38

Out of curiosity ... are you able to do sorting? (I presume sorting would have the same issue as paging, but best to be complete.) What about filtering? There were some reports in 2.2 of sorting and I think paging not working until filtering was started. But overall I'm sure the Primefaces devs would be helped by that information.
Latest: Tomcat 7.0.68, JSF Mojarra 2.2.8-11, Primefaces: 6.0.0
Previous: Tomcat 7.0.22, JSF Mojarra 2.1.3, Primefaces: 2.2.1
Previous: Tomcat 6.0.32, JSF Mojarra 1.2_12-b01-FCS, Facelets 1.1.14, Primefaces 1.1
Browser: latest FF, IE, Chrome and Safari

User avatar
kwintesencja
Posts: 316
Joined: 08 Feb 2010, 20:33
Location: Brazil

14 Nov 2011, 02:30

Hi mouse, ive attached a testing project in the issue as it got invalidated, could you try that in you enviroment?

maybe its something im doing wrong.


thanks.



edit: the sorting is working
Att,

--

Rafael Mauricio Pestano


Primefaces 5.x + JavaEE7(Glassfish 4.x and Wildfly 8)
Conventions Framework
Blog
@realpestano

User avatar
kwintesencja
Posts: 316
Joined: 08 Feb 2010, 20:33
Location: Brazil

18 Nov 2011, 04:19

Hi everyone, i've got some progress here:


1 - For the first problem showed in this topic, the workaround was adding a h:panelGroup inside the composite component surrounding the insertChildren tag
2 - I have found another problem with datatable pagination under composite components inside dialogs - a p:panel was breaking the datatable
3 - i have made a video which demostrates the mentionated problems: http://www.youtube.com/watch?v=v9K7Qx58fZs
4 - also attached the updated project and war to the issue http://code.google.com/p/primefaces/iss ... il?id=2769

i have tested with primefaces M4 and RC1-SNAPSHOT, also switched glassfish and mojarra versions without sucess.

i hope it helps someone.
Att,

--

Rafael Mauricio Pestano


Primefaces 5.x + JavaEE7(Glassfish 4.x and Wildfly 8)
Conventions Framework
Blog
@realpestano

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: Google [Bot] and 50 guests