当用户点击ui:repeat中的p:graphics
Image时,我想做一些处理
我该怎么做.
我该怎么做.
<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部分不会被触发.
如何监控a点击’p:graphicImage’
解决方法
< p:graphicImage>不支持任何ajax事件.
只需将其包装在< h:commandLink>中即可. (或p:one).
<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>