Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I am using <p:graphicImage> like below:

<div id="mapp">
    <h3>Country Map</h3>         
    <p:graphicImage id="city"
                    value="#{countryPages_Setup.countryMap}"
                    width="250"
                    height="190">

     </p:graphicImage>                
</div>

But this is not a clickable image. How can I make this image clickable so when user click on it, I can invoke the managed bean action that I want.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
3.4k views
Welcome To Ask or Share your Answers For Others

1 Answer

Wrap your image in a h:commandLink / h:link:

<h:commandLink action="...">
  <p:graphicImage id="city"
            value="#{countryPages_Setup.countryMap}"
            width="250"
            height="190">
  </p:graphicImage>
</h:commandLink>

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share

548k questions

547k answers

4 comments

86.3k users

...