我正在使用 <p:graphicImage>
像下面这样:
<div id="mapp">
<h3>Country Map</h3>
<p:graphicImage id="city"
value="#{countryPages_Setup.countryMap}"
width="250"
height="190">
</p:graphicImage>
</div>
但这不是可点击的图像。如何使此图像可点击,以便当用户点击它时,我可以调用我想要的托管 bean 操作。
最佳答案
将您的图像包裹在 h:commandLink
中/h:link
:
<h:commandLink action="...">
<p:graphicImage id="city"
value="#{countryPages_Setup.countryMap}"
width="250"
height="190">
</p:graphicImage>
</h:commandLink>
关于jsf - 如何制作 p :graphicImage clickable and invoke bean action,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9924603/