views:

77

answers:

1

I have created a page with primefaces where I use the Lightbox component.

I use it in a dynamic matter as I create tumbnails on the fly with a servlet call.

The first page shows up nice and the lightbox works as expected but when I load a new set of pictures for the next page the pictures are shown but when you click on it, it just shows the original picture in a new page, when I then return with the previous button and click on a a thumbnail it works as expected.

This is the jsf code:

<h:outputLabel id="curpage" value="#{pictureBean.currentPage}" />
<h:commandButton value="next" action="#{pictureBean.nextPage}" id="next">
 <f:ajax render="lightBox curpage" />
</h:commandButton>

<br/>

<p:lightBox height="500px" id="lightBox">
    <ui:repeat value="#{pictureBean.pictures}" var="pic">
        <h:outputLink value="#{pic.url}" title="#{pic.description}">
           <h:graphicImage value="#{pic.urlThumb}" style="width:100px;height:75px;"/>
        </h:outputLink>
    </ui:repeat>
</p:lightBox>
A: 

I fixed it myself :-) I was forgotten to add the tags between form tags.

Simon van Wingerden