-
1. Re: useMap with a4j:mediaOutput
nbelaevski Apr 7, 2009 9:06 AM (in response to njrfrens)Hi,
How do you declare MAP object? -
2. Re: useMap with a4j:mediaOutput
njrfrens Apr 7, 2009 11:49 AM (in response to njrfrens)ChartUtilities.writeImageMap(new PrintWriter(out), "chart", info, true); will write the map with id "chart".
-
3. Re: useMap with a4j:mediaOutput
njrfrens Apr 7, 2009 11:53 AM (in response to njrfrens)I tried in a different way also, like...
I stored in the stored image map in a String variable
'imageMap', in my Bean Class.
and referred in this way... This way also didn't work for me :-(
<a4j:mediaOutput element="img" cacheable="false" session="true" usemap="#myMap"
createContent="#{myBean.getChartImage}"
mimeType="image/jpeg" />
<h:outputText escape="false" value="#{myBean.imageMap}" /> -
4. Re: useMap with a4j:mediaOutput
nbelaevski Apr 7, 2009 12:51 PM (in response to njrfrens)"njrfrens" wrote:
That's a better approach. "createContent" method is called in a separate request to render image data, so the first approach won't work.
I tried in a different way also, like...
I stored in the stored image map in a String variable
'imageMap', in my Bean Class.
and referred in this way... This way also didn't work for me :-(
<a4j:mediaOutput element="img" cacheable="false" session="true" usemap="#myMap"
createContent="#{myBean.getChartImage}"
mimeType="image/jpeg" />
<map id="myMap" name="myMap">
<h:outputText escape="false" value="#{myBean.imageMap}" />
</map>
Have you checked generated HTML? Is MAP present there? -
5. Re: useMap with a4j:mediaOutput
njrfrens Apr 8, 2009 4:37 AM (in response to njrfrens)something suspicious with the method in createContent...
I declared the imageMap as an instance variable in my Bean class.
and I'm setting the value for imageMap variable inside the getChartImage method of of myBean with the appropriate imageMap.
But the value is not set for this imageMap variable... -
6. Re: useMap with a4j:mediaOutput
nbelaevski Apr 8, 2009 6:12 AM (in response to njrfrens)getChartImage() is called after myBean.imageMap is output, because image tag is first rendered, then image data is requested. Probably, that's the cause? What is bean scope?
-
7. Re: useMap with a4j:mediaOutput
njrfrens Apr 8, 2009 7:02 AM (in response to njrfrens)Hmm... seems there lies the problem...
I tried putting my bean in session and request scope... still no luck...
any advise please?