当用户单击 ui:repeat 中的 p:graphicsImage 时,我想做一些处理
我该怎么做。
<ui:repeat id="repeat" value="#{getData.image}" var="imageLst" varStatus="loop">
<h:panelGroup>
<p:graphicImage id="gi1" value="#{imageStreamer.image}" alt="image not available" >
<f:param name="id" value="#{imageLst.imageID}" />
<p:ajax id="aj2" event="click" listener="#{getData.searchID}" immediate="true" update=":form:tabView:check :form:growl"/>
</p:graphicImage>
</h:panelGroup>
</ui:repeat>
在上面的代码中,如果我放置 ajax 部分不会被触发。
我如何监控“p:graphicImage”上的点击
最佳答案
<p:graphicImage>
不支持任何 ajax 事件。
只需将其包裹在 <h:commandLink>
中(或 p:
一个)。
<h:commandLink>
<p:graphicImage id="gi1" value="#{imageStreamer.image}" alt="image not available" >
<f:param name="id" value="#{imageLst.imageID}" />
</p:graphicImage>
<p:ajax id="aj2" listener="#{getData.searchID}" update=":form:tabView:check :form:growl"/>
</h:commandLink>
关于ajax - 如何在单击 p :graphicImage? 时触发 ajax 事件监听器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10963171/