重新渲染<h:graphicimage by =“”<p:commandbutton =“”

时间:2017-08-30 17:52:45

标签: jsf primefaces

=“”

假设我有一个下一个图形图像标签形式

<p:lightBox styleClass="imagebox " id="imageLightBox" rendered="true">
   <h:outputLink value="http://..../center/#{myBean.centerId}/picture" title="Bla bla bla">
       <h:graphicImage value="http://..../center/#{myBean.centerId}/picture" />
   </h:outputLink>
</p:lightBox>

我有下一个primefaces命令按钮

<p:commandButton icon="fa fa-save" value="Save" title="Save" actionListener="#{myBean.saveCenterImage()}" update="@form" >

那么当我点击 commandButton 时,如何重新渲染 graphicImage

1 个答案:

答案 0 :(得分:3)

我认为您需要使用p:graphicImage而不是h:graphicImage并设置属性cache = false,以便浏览器不会缓存图片。