Galleria and description

UI Components for JSF
Post Reply
Manu206
Posts: 33
Joined: 25 Mar 2011, 16:15

19 Apr 2011, 18:04

Is there a way to get for each image in the gallery a different description from the GalleriaBean?

Code: Select all

<p:galleria effect="#{galleriaBean.effect}" effectSpeed="1000">
    <ui:repeat value="#{galleriaBean.images}" var="image">
        <p:graphicImage value="/images/galleria/#{image}" title="#{image}" alt="[b]something like #{image.imagedescription}????[/b]"/>
    </ui:repeat>
</p:galleria>
I need multiple parameters in the ui:repeat to pass more information to the image ;)

Hope someone has a solution ;)
Primefaces 3.5
Mojarra 2.1.9
Netbeans 7.3.x
Glassfish 3.2.1

tandraschko
PrimeFaces Core Developer
Posts: 3979
Joined: 03 Dec 2010, 14:11
Location: Bavaria, DE
Contact:

19 Apr 2011, 20:58

you could create a container for the image and the description.

for example

Code: Select all

public class MyContainer {
       private String image;
       private String imageDescription;

       ....
}

public class GalleriaBean {

       private List<MyContainer> images;
}

<p:galleria effect="#{galleriaBean.effect}" effectSpeed="1000">
    <ui:repeat value="#{galleriaBean.images}" var="image">
        <p:graphicImage value="/images/galleria/#{image.image}" title="#{image}" alt="[b]something like #{image.imageDescription}[/b]"/>
    </ui:repeat>
</p:galleria>

Thomas Andraschko

PrimeFaces | PrimeFaces Extensions

Apache Member | OpenWebBeans, DeltaSpike, MyFaces, BVal, TomEE

Sponsor me: https://github.com/sponsors/tandraschko
Blog: http://tandraschko.blogspot.de/
Twitter: https://twitter.com/TAndraschko

Manu206
Posts: 33
Joined: 25 Mar 2011, 16:15

19 Apr 2011, 23:09

Thank you very much for your answer ;)

This solution will work for me ;)
Primefaces 3.5
Mojarra 2.1.9
Netbeans 7.3.x
Glassfish 3.2.1

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 31 guests