2

我想为使用<p:galleryImage/>. 问题是当画廊包含大量图像时,它会下载所有图像,然后显示它们。这真的很烦人,它必须以不同的方式工作。现在画廊看起来像这样:

<p:lightBox>
    <h:commandButton class="button  button-1-3 graphics-portfolio-plakaty" onclick="plakaty.show();" />
    <f:facet name="inline">
        <p:galleria value="#{galleryBean.imageNames}" var="imageName" panelWidth="800" panelHeight="500">  
            <p:graphicImage value="/gallery?img=#{imageName}" cache="false" />
        </p:galleria>
    </f:facet>
</p:lightBox>

我想使用 ajax 加载图像,所以它应该看起来像这样。

<p:lightBox>
    <h:commandButton class="button  button-1-3 graphics-portfolio-plakaty" onclick="plakaty.show();" />
    <f:facet name="inline">
        <p:galleria value="#{galleryBean.imageNames}" var="imageName" panelWidth="800" panelHeight="500">  
            <p:graphicImage value="/gallery?img=#{imageName}" cache="false">
                <p:ajax event="ready" />
            </p:graphicImage>
        </p:galleria>
    </f:facet>
</p:lightBox>

我是 JSF 的新手,所以可能有更好的方法来做到这一点,或者如何使用 ajax 加载图像?

4

0 回答 0