Paginator, like the name sort of suggests, creates page links (e.g. 234
5 678) between prev and next page links.

Kalle 


________________________________

        From: Travis Reeder [mailto:[EMAIL PROTECTED] 
        Sent: Tuesday, December 14, 2004 6:37 PM
        To: MyFaces Discussion
        Subject: Re: Data scroller with bound variables for pageCountVar
and pageIndexVar
        
        
        Oh jeez, my bad, I just figured out how this is supposed to
work, I didn't realize it did most of the work for you.
        
        What's the paginator all about?
        
        Travis
        
        Travis Reeder wrote: 

                Ok, 
                
                I tried it by binding like so:
                
                pageCountVar="#{myBean.pageCount}"
                pageIndexVar="#{myBean.pageIndex}"
                
                Both Integers, but I get this.  
                
                java.lang.ClassCastException: java.lang.Integer
                    at
org.apache.myfaces.custom.datascroller.HtmlDataScroller.getPageCountVar(
HtmlDataScroller.java:185)
                    at
org.apache.myfaces.custom.datascroller.HtmlDataScrollerRenderer.encodeCh
ildren(HtmlDataScrollerRenderer.java:171)
                    at
javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.jav
a:317)
                    at
javax.faces.webapp.UIComponentTag.encodeChildren(UIComponentTag.java:370
)
                
                Can someone explain how those are supposed to work?  My
assumption is that they are just like sortBy and ascending in
x:dataTable where if I click on it, those variables get set
appropriately.  For example, if i click on forward one in the data
scroller, I would expect the pageIndexVar to be incremented by one.  Is
this not the case?  
                
                The classcast is here, because it's expecting a string.
                
                    if (_pageIndexVar != null) return _pageIndexVar;
                        ValueBinding vb =
getValueBinding("pageIndexVar");
                        return vb != null ?
(String)vb.getValue(getFacesContext()) : null;
                
                Travis
                
                
                
                Korhonen, Kalle wrote: 

                        I haven't tried pageCountVar, and I don't see
how binding it to a
                        property would be useful, as the bean should
already be the source of
                        the table data and thus should know the count,
but I'm using
                        pageIndexVar exactly like that and I don't need
to guess; I *know* it
                        works.
                        
                        Kalle 
                        
                          

                                -----Original Message-----
                                From: Catalin Kormos
[mailto:[EMAIL PROTECTED] 
                                Sent: Thursday, December 09, 2004 12:25
AM
                                To: MyFaces Discussion
                                Subject: RE: Data scroller with bound
variables for 
                                pageCountVar and pageIndexVar
                                
                                And it works? i guess it does't. To
reset the dataTable to 
                                the first page, or any page, there is
the "first" attribute 
                                for the dataTable which can be bound to
a bean property.
                                
                                The attributes "pageIndexVar" and
"pageCountVar" of the 
                                dataScroller are like the "var"
attribute of the dataTable, 
                                you can use the value of them inside the
dataScroller.
                                
                                <x:dataScroller id="scroll_2"
                                                for="data"
        
pageCountVar="#{myBean.count}"        
                                                  
        
pageIndexVar="#{myBean.index}">
                                
                                
                                --- "Korhonen, Kalle"
<[EMAIL PROTECTED]> <mailto:[EMAIL PROTECTED]>  wrote:
                                
                                    

                                        Can't? I'm using pageIndexVar
bound to a bean property exactly like 
                                        that, to reset to the first page
etc.
                                        
                                        Kalle
                                        
                                              

                                        -----Original Message-----
                                        From: Travis Reeder
                                                

        
[mailto:[EMAIL PROTECTED]
                                              

                                        Sent: Thursday, December 09,
2004 12:00 AM
                                        To:
[EMAIL PROTECTED]
                                        Subject: Data scroller with
bound variables for
                                                

                                        pageCountVar
                                              

                                        and pageIndexVar
                                        
                                        Is there any reason pageCountVar
and pageIndexVar
                                                

                                        can't be
                                              

                                        bound to a value like sortColumn
and sortAscending
                                                

                                        are in the
                                              

                                        x:dataTable ?  for
                                        example:
                                        <x:dataScroller id="scroll_2"
        
for="data"
                                                                   
                                                

                                        pageCountVar="#{myBean.count}"
                                              

                                                                   
                                                

                                        pageIndexVar="#{myBean.index}"
                                              

                                                                    >
                                        
                                        
                                        --
                                        Travis Reeder
                                        Ecommstats Web Analytics
                                        
                                        
                                                

                                                
                                __________________________________
                                Do you Yahoo!? 
                                Yahoo! Mail - Easier than ever with
enhanced search. Learn more.
                                http://info.mail.yahoo.com/mail_250
                                
                                
                                    

                        
                          


                -- 
                Travis Reeder
                Ecommstats Web Analytics
                www.ecommstats.com
                  


        -- 
        Travis Reeder
        Ecommstats Web Analytics
        www.ecommstats.com
        

Reply via email to