2 Replies Latest reply on Oct 7, 2009 2:29 PM by fkj

    Problem with EntityQuery + AJAX paging

    fkj

      I've tried to adapt a seam-gen listing to use AJAX, but I can only move to the second page, after that when I hit Next page I always get the same result.


      Thanks for any help,
      Felipe

        • 1. Re: Problem with EntityQuery + AJAX paging
          blabno

          Source code of query and facelet please. I'm successfully using rich:datascroller and EntityQuery for database pagination.

          • 2. Re: Problem with EntityQuery + AJAX paging
            fkj

            I got it working the following way:


            TbmotaltList.xhtml:


            <a4j:commandButton
                                                rendered="#{tbmotaltList.nextExists}"
                                                action="#{tbmotaltList.next}"
                                                value="Next Page #{messages.right}"
                                                reRender="tbmotaltList"
                                            />




            TbmotaltList.page.xml:



            <param name="firstResult" value="#{tbmotaltList.firstResult}"/>




            But if I comment the parameter in TbmotaltList.page.xml and add it to the commandButton in TbmotaltList.xhtml it doesn't works:




                    <a4j:commandButton
                                                rendered="#{tbmotaltList.nextExists}"
                                                action="#{tbmotaltList.next}"
                                                value="Next Page #{messages.right}"
                                                reRender="tbmotaltList"
                                            >
                                                <a4j:actionparam
                                                    name="firstResult"
                                                    value="#{tbmotaltList.firstResult}"
                                                />
                                            </a4j:commandButton>
            




            Any ideias? I'd like to use only the xhtml file.


            In other pages I'd like to use the rich:datascroller component. Could you explain how do you use it too? Did you have to comment setMaxResults() in your EntityQuery?


            Thanks a lot,
            Felipe