3 Replies Latest reply on Mar 16, 2011 3:05 AM by serkan.s.eskici.online.nl

    X-Y clickable s:graphicimage server side image map

    iksdrijf
      Hi, I would like to dynamically generate an image that can be clicked to send the x-y coordinates to a conversation-scoped Stateful Session Bean. Generating the image and displaying it is very straightforward with s:graphicimage. However, very little is documented about how to communicate clicks with coordinates back to the SFSB: the ismap property has to be set to true, and some docs mention that the s:graphicimage has to be used with a <a> tag.

      I have no idea how to go any further. For now, I am using some messy Javascript, but that gets e further entangled in kludges.

      Has anybody had success with server side Seam image maps? Or knows another trick to get single-pixel resolution clicks communicated back to the right conversation-scoped SFSB?

      Cheers, Martin.



        • 1. Re: X-Y clickable s:graphicimage server side image map
          lsfer

          Hi Martin!


          In my work, I need to do the same thing you describe above, and I have no ideia how can I do it.


          Do you solve your problem? Can you help me somehow?


          I´am using the s:grapicImage to show de image from database using a byte array and works fine.


          But I don´t know how can I display the server side maps for this image, and how can I dynamically mapping the coordinates.


          Thanks.

          • 2. Re: X-Y clickable s:graphicimage server side image map
            antibrumm.mfrey0.bluewin.ch

            Hi
            I had the same request to do for my customer but this was for a chart created with jfreechart. I used the seam library for this and what i did was using the imagemap tag to achieve this goal.


            For this i extended the p:chart tag to take another attribute mapname and if this one is set the component will render the imagemap for the chart in the encodeend method. This was pretty straight forward. The big difference to your case would be that you have to code that imagemap creation yourself while jfreechart provided me this feature directly for my graph.


            Hope this helps.

            • 3. Re: X-Y clickable s:graphicimage server side image map
              serkan.s.eskici.online.nl

              I don't know much about image maps, but you can send the coordinates with JS to your managed bean by making use of Seam remoting.

              Refer to the reference guide for more info about seam remoting.