0
我創建了一個包含使用Lightbox組件的primefaces的頁面。Primefaces lightBox問題
我在一個動態的問題中使用它,因爲我通過servlet調用來動態創建tumbnails。
第一頁顯示效果不錯,並且燈箱按預期工作,但是當我爲下一頁加載一組新圖片時,會顯示圖片,但是當您點擊它時,它只會在新頁面中顯示原始圖片,當我然後返回與前一個按鈕,並單擊縮略圖它按預期工作。
這是JSF代碼:
<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>