Martin Marinschek wrote:
Ideally,
you would build an image map JSF component.
I already created such a component,, but maybe its too limited to get
added to myfaces.
Its sort of "my first component" and maybe too restricted to my application.
I used it in conjunction with jfreechart to be able to click into the graph.
It works like this:
<h:inputHidden id="annotateEvent" value="#{AnnotationForm.eventNumber}"/>
<h:graphicImage
binding="#{EventDataProvider.image}"
url="#{EventDataProvider.url}"
alt="WateringData"
width="900"
height="600"
usemap="#CHART_TOOLTIP"
/>
<s:area
mapName = "CHART_TOOLTIP"
action = "annotateSpot"
areas="#{EventDataProvider.areas}"
destField="annotateEvent"
/>
The hidden field is required for the s:area component (see destField=).
With my knowledge today I could get rid of this hidden field.
The areas are passed in through an ArrayList of ImageMapArea.java
instances which is a simple bean with "shape, coords, title and data".
data is the value you might find in "destField" then.
Sayed all that: If one find it useable that way I can contribute it.
---
Mario