O'Reilly logo

PrimeFaces Cookbook - Second Edition by Oleg Varaksin, Mert Çalışkan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Displaying a collection of images with imageSwitch

The imageSwitch component can be used to display a collection of images with transition effects.

How to do it…

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

<p:imageSwitch id="simple">
  <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:imageSwitch>

The snippet will be visualized as follows:

How to do it…

The preceding image is seen as a static ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required