Is there an easy way to further control the datascroller functionality – specifically, not display the ‘previous’ or ‘first’ control if on the first page of data (and also not display the ‘next’ or ‘last’ control if on the last page of data)?

 


From: Miller, John [mailto:[EMAIL PROTECTED]
Sent: Thursday, January 12, 2006 8:55 AM
To: MyFaces Discussion
Subject: RE: dataScroller

 

DataScroller by default will not render if there is only one page of data, however the facets will, you can turn this off by simply adding the following attribute to your datascroller

 

renderFacetsIfSinglePage="false"

 

 


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Thursday, January 12, 2006 7:15 AM
To: users@myfaces.apache.org
Subject: AW: dataScroller

 

Another possible is that you set the rendered attribute of the datascroller  to false or true at the point where you get your list for the datatable in the backing bean.

e.g something like that in your backing bean:

 

rowList is the result you will display on the datatable. In my example a datascroller will only be displayed if the list contains more than 5 items.

 

 if (rowList.size() > 5) {
    dbAdminDto.setShowDatascroller(true);
   }
   else {
    dbAdminDto.setShowDatascroller(false);
   }

 

 

in the JSP:

<t:dataScroller...

    rendered="#{dbAdminDto.showDatascroller}"

...

/>

 

I hope it's clear, what I mean...

 

Regards

Andy

 

-----Ursprüngliche Nachricht-----
Von: Vladimir Coutinho [mailto:[EMAIL PROTECTED]
Gesendet: Donnerstag, 12. Januar 2006 13:08
An: myfaces user list
Betreff: dataScroller

I'm trying to render a dataScroller only when the number of rows of the table are greater than rows exibited on a page.
I tried this :  rendered="#{((rowsCount>displayedRowsCountVar) ? true : false)}" , but the dataScroller is not displayed, despite the number of rows.
...................
<%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t"%>
...................
 <t:dataScroller id="scroll_1"
                    for="">                     fastStep="3"
                    pageCountVar="pageCount"
                    pageIndexVar="pageIndex"
                    rowsCountVar="rowsCount"
                    styleClass="scroller"
                    displayedRowsCountVar="displayedRowsCountVar"
                    firstRowIndexVar="firstRowIndex"
                    lastRowIndexVar="lastRowIndex"
                    pageCountVar="pageCount"
                    paginator="true"
                    paginatorMaxPages="6"
                    paginatorTableClass="paginator"
                    rendered="#{((rowsCount>displayedRowsCountVar) ? true : false)}"                    
                    paginatorActiveColumnStyle="font-weight:bold;">
......................


______________________________________________________________________ This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify your system manager. This footnote also confirms that this email message has been swept for the presence of computer viruses. ______________________________________________________________________

 


NOTICE: This message, including all attachments transmitted with it, is for the use of the addressee only. It may contain proprietary, confidential and/or legally privileged information belonging to Litle & Co. No confidentiality or privilege is waived or lost by any mistransmission. If you are not the intended recipient, you must not, directly or indirectly, use, disclose, distribute, print or copy any part of this message. If you believe you have received this message in error, please delete it and all copies of it from your system and notify the sender immediately by reply e-mail. Thank you.

Reply via email to