2

I am trying to replicate the below html page using JSF. But can't find the correct JSF tag to do so.

HTML content (Required HTML):

<body>
<div class="image">
    <img src="image.jpg" alt="Image" usemap="#Map" border="0" />
    <map name="Map" id="Map">
        <area shape="circle" id="circle" coords="135,596,34" href="http://www.google.co.in" alt="Circle" />
        <area shape="rect" id="square" coords="192,567,249,628" href="http://www.youtube.com" alt="Square" />
    </map>
</div>
</body>

JSF Page (JSF to be modified to get above HTML):

<body>
<f:view>
<h:outputText value="This is a JSF page"></h:outputText>
<br/>
<h:form>
<h:graphicImage id="image" value="image.jpg" usemap="true">
    <h:commandLink action="#{managedBean.method}" id="links1" value="map1" coords="135,596,34" shape="circle"></h:commandLink>
    <h:commandLink action="#{managedBean.method}" id="links2" value="map2" coords="192,567,249,628" shape="rec"></h:commandLink>
</h:graphicImage>
</h:form>
</f:view>
</body>

Please suggest the correct JSF format to replicate the above HTML page using the JSF page and it calls a method of ManagedBean when clicked on the link.

ragrawal3
  • 43
  • 1
  • 5
  • you should try using the , also look into the – myselfmiqdad Dec 16 '15 at 16:29
  • i am willing to call the managedBean method on onclick of the link, but that way i will not be able to call the methods. Is there any way so that link is placed using JSF and onclick it calls the method of managedBean – ragrawal3 Dec 16 '15 at 16:37
  • So you want to invoke a specific method in your bean from the commandLink? – myselfmiqdad Dec 16 '15 at 16:43
  • Yes. its like links should be present on specific coordinate on a single image and all the link on the image should invoke a specific method. – ragrawal3 Dec 16 '15 at 17:05

0 Answers0