Displaying data with sliding effects using the Carousel component
Carousel is a multipurpose component to display a set of data or general content with slide effects.
On many websites, a Company's information such as what they do, about their products and other types of services they provide, will be displayed in a slideshow style. We can use the Carousel component to implement this kind of feature.
Suppose we are building an e-commerce bookstore application and want to display all the latest books on the home page in a slideshow style. Let us see how we can use a <p:carousel>
component to implement this.
<p:carousel value="#{carouselController.books}" var="book" headerText="Latest Books"> <h:panelGrid columns="1" style="width:100%" cellpadding="5"> <p:graphicImage value="/resources/images/books/#{book}" width="180px" height="220px;"/> </h:panelGrid> <...