Hi Daniel,

look at this:

       public DataPage<Paciente> fetchPage(int startRow, int pageSize) {
           return getDataPage(startRow, pageSize);
       }

if you make sure you call getDataPage only once for any given
startRow/pageSize, you'll be save - so you need some caching there.

regards,

Martin

On 7/4/07, daniel ccss <[EMAIL PROTECTED]> wrote:
Since everything works fine, I think that the problem is in the JSP
t:dataScroller and t:dataTable properties, something is calling the backing
bean several times (the fetchPage), I'm new in this, can anyone check the
JSP and see if I´m doing something wrong on it causing the multiple calls?



<%@ page contentType="text/html;charset=windows-1252"%>
<%@ taglib uri=" http://java.sun.com/jsf/html"; prefix="h"%>
<%@ taglib uri="http://java.sun.com/jsf/core"; prefix="f"%>
<%@ taglib uri=" http://myfaces.apache.org/tomahawk "
prefix="t"%>
<f:view>
    <html>
        <head>
            <meta http-equiv="Content-Type"
                  content="text/html; charset=windows-1252"/>
            <title>listaPacientes</title>
        </head>
        <body><h:form>
                <h:panelGroup id="body">
                    <t:dataTable id="data" styleClass="scrollerTable"

headerClass="standardTable_Header"

footerClass="standardTable_Header"

rowClasses="standardTable_Row1,standardTable_Row2"

columnClasses="standardTable_Column,standardTable_ColumnCentered,standardTable_Column"
                                 var="tablaPacientes"
                                 value="#{
PacienteBean.dataModel}"
                                 preserveDataModel="false"
rows="2">
                        <h:column>
                            <f:facet name="header"></f:facet>
                            <h:outputText
value="#{tablaPacientes.numIdent}"/>
                        </h:column>
                        <h:column>
                            <f:facet name="header"></f:facet>
                            <h:outputText value="#{tablaPacientes.nombre}"/>
                        </h:column>
                    </t:dataTable>
                    <h:panelGrid columns="1" styleClass="scrollerTable2"

columnClasses="standardTable_ColumnCentered">
                        <t:dataScroller id="scroll_1" for="data"
fastStep="10"

pageCountVar="pageCount"

pageIndexVar="pageIndex"

styleClass="scroller" paginator="true"

paginatorMaxPages="9"

paginatorTableClass="paginator"

paginatorActiveColumnStyle="font-weight:bold;"
                                        immediate="true">
                            <f:facet name="first">
                                <t:graphicImage url="images/arrow-first.gif"

border="1"/>
                            </f:facet>
                            <f:facet name="last">
                                <t:graphicImage url="images/arrow-last.gif"

border="1"/>
                            </f:facet>
                            <f:facet name="previous">
                                <t:graphicImage
url="images/arrow-previous.gif"

border="1"/>
                            </f:facet>
                            <f:facet name="next">
                                <t:graphicImage url="images/arrow- next.gif"

border="1"/>
                            </f:facet>
                            <f:facet name="fastforward">
                                <t:graphicImage url="images/arrow- ff.gif"

border="1"/>
                            </f:facet>
                            <f:facet name="fastrewind">
                                <t:graphicImage url="images/arrow- fr.gif"

border="1"/>
                            </f:facet>
                        </t:dataScroller>
                        <t:dataScroller id="scroll_2" for="data"

rowsCountVar="rowsCount"

displayedRowsCountVar="displayedRowsCountVar"

firstRowIndexVar="firstRowIndex"

lastRowIndexVar="lastRowIndex"

pageCountVar="pageCount"
                                        immediate="true"

pageIndexVar="pageIndex">
                            <h:outputFormat
value="#{example_messages[\'dataScroller_pages\']}"

styleClass="standard">
                                <f:param value="#{rowsCount}"/>
                                <f:param
value="#{displayedRowsCountVar}"/>
                                <f:param value="#{firstRowIndex}"/>
                                <f:param value="#{lastRowIndex}"/>
                                <f:param value="#{pageIndex}"/>
                                <f:param value="#{pageCount}"/>
                            </h:outputFormat>
                        </t:dataScroller>
                    </h:panelGrid>
                </h:panelGroup>
                <t:commandLink value="test" immediate="true"/>
            </h:form></body>
    </html>
</f:view>


On 7/3/07, daniel ccss < [EMAIL PROTECTED]> wrote:
> I really need help with this, nobody has implemented succesfuly the
datascroller +  WorkingWithLargeTables article? How do you people implement
the pagination with a Tomahawk dataScroller, without bring all the records?
For me all works fine my problem is that the method that brings the data is
call several times for each DataPage.
>
>
>
> On 7/3/07, daniel ccss < [EMAIL PROTECTED]> wrote:
> > Ok let's see, the backing bean is in request:
> >
> > <managed-bean>
> >  <description>Pacientes
> >  </description>
> >  <managed-bean-name>PacienteBean</managed-bean-name>
> >
<managed-bean-class>controller.pacientes.PacienteBean</managed-bean-class>
> >  <managed-bean-scope>request</managed-bean-scope>
> >  </managed-bean>
> >
> > How can I use the cache for a Backing Bean? Some Guru that can help me?
I can give you all my Jdeveloper project and you can test it?
> >
> > Any other idea, thanks!!
> >
>
>




--

http://www.irian.at

Your JSF powerhouse -
JSF Consulting, Development and
Courses in English and German

Professional Support for Apache MyFaces

Reply via email to