Book Image

Primefaces Cookbook Second Edition

Book Image

Primefaces Cookbook Second Edition

Overview of this book

Table of Contents (20 chapters)
PrimeFaces Cookbook Second Edition
Credits
Foreword
Foreword
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Displaying a collection of images with galleria


The galleria component can be used to display a collection of images with a transition effect.

How to do it…

A basic definition for the galleria component for viewing a static list of car images would be as follows:

<p:galleria>
  <p:graphicImage value="/resources/images/autocomplete/CC.png" />
  <p:graphicImage
    value="/resources/images/autocomplete/Golf.png" />
  <p:graphicImage
    value="/resources/images/autocomplete/Polo.png" />
  <p:graphicImage 
    value="/resources/images/autocomplete/Touareg.png" />
</p:galleria>

How it works…

The definition of the galleria component renders a car image in a panel and four other small images in a filmstrip right below it. This component also provides built-in iteration effects for the transition to occur between the images, which are provided by the autoPlay attribute, set as true by default. The transition happens within 4000 milliseconds and can be customized with...