Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

datascroller pageIndex problem

843842May 20 2005 — edited Dec 26 2008
Hi,

I'm a bit confused of using datascroller component (myfaces).

Basically the scroller works fine, when I use it once or the rowCount of data never changes. I get in trouble when I change the pageIndex.

Example:

1. datatable has 100 rows, scroller shows 10 rows
2. I jump to page 5
... everything is fine

After this I the data changes

datatable has now 5 rows

And now the problem comes out: The pageIndex of the scrollerComponent is still on page 5 ... and ... there is no data :-( When I jump to page 1 manually (by rewind-button) the data shows up on the first page.

Would should I do to see always page 1, when the jsf-page is called?

code snippet of jsf
				<h:form name="hitlist">					
					<x:dataTable  id="hitlisttable" 
                                    styleClass="standardTable"
                                    headerClass="standardTable_Header"
                                    rowClasses="hitlistTable_Row1, hitlistTable_Row2"                                    
                                    binding="#{HitlistBean.hitlistTable}" 
                                    var="hit" 
                                    value="#{HitlistBean.hitlistDAO.hitList}"  
                                    rendered="#{HitlistBean.hitlistDAO.isHitlistFilled}" 
                                    rows="13"/>
					

				<h:panelGrid columns="1" styleClass="scrollerTable2" columnClasses="standardTable_ColumnCentered" >
                    <x:dataScroller id="scroll_1"
                            for="hitlisttable"
                            fastStep="10"
                            pageCountVar="pageCount"
                            pageIndexVar="pageIndex"
                            styleClass="scroller"
                            paginator="true"
                            paginatorMaxPages="9"
                            paginatorTableClass="paginator"
                            paginatorActiveColumnStyle="font-weight:bold;"
                            >
                        <f:facet name="first" >
                            <h:graphicImage url="/images/arrow-first.gif" border="1" />
                        </f:facet>
                        <f:facet name="last">
                            <h:graphicImage url="/images/arrow-last.gif" border="1" />
                        </f:facet>
                        <f:facet name="previous">
                            <h:graphicImage url="/images/arrow-previous.gif" border="1" />
                        </f:facet>
                        <f:facet name="next">
                            <h:graphicImage url="/images/arrow-next.gif" border="1" />
                        </f:facet>
                        <f:facet name="fastforward">
                            <h:graphicImage url="/images/arrow-ff.gif" border="1" />
                        </f:facet>
                        <f:facet name="fastrewind">
                            <h:graphicImage url="/images/arrow-fr.gif" border="1" />
                        </f:facet>
                    </x:dataScroller>
                    <x:dataScroller id="scroll_2"
                            for="hitlisttable"
                            rowsCountVar="rowsCount"
                            displayedRowsCountVar="displayedRowsCountVar"
                            firstRowIndexVar="firstRowIndex"
                            lastRowIndexVar="lastRowIndex"
                            pageCountVar="pageCount"
                            pageIndexVar="pageIndex"
                            binding="#{HitlistBean.hitlistDataScroller}" 
                            >
                        <h:outputFormat value="{0} Treffer, aktuell {1} Treffer, Treffer von {2} bis {3}. Seite {4} / {5}
                        " styleClass="standard" >
                            <f:param name="myRowsCount" value="#{rowsCount}" />
                            <f:param name="myDisplayedRowsCountVar" value="#{displayedRowsCountVar}" />
                            <f:param name="myFirstRowIndex" value="#{firstRowIndex}" />
                            <f:param name="myLastRowIndex" value="#{lastRowIndex}" />
                            <f:param name="myPageIndex" value="#{pageIndex}" />
                            <f:param name="myPageCount" value="#{pageCount}" />
                        </h:outputFormat>
                    </x:dataScroller>
                </h:panelGrid>
I tried to get the 'pageIndex' var of the scroller to reset it each time to new Integer(0).
But how can I get this parameter? I can read the params of outputFormat but they have all 'null' values.

Should'nt reset the scroller component itself, when the rowcount changed?

Any help would be very appreciated.

thanks Stephan
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 23 2009
Added on May 20 2005
18 comments
1,386 views