The simplified situation looks like this: I have a picture in a page. The user clicks on it, and I have to store it's address. For example: <h:graphicImage value="img/pic01.jpg"> </h:graphicImage> and I need to store somewhere, in a context variable or something, the value: "img/pic01.jpg", in order to access it later in the page. How can I do that?
You could do something like:
<h:graphicImage url="img/pic01.jpg" onclick="storePicture(this.src);"/> <h:graphicImage url="img/pic02.jpg" onclick="storePicture(this.src);"/> <a4j:jsFunction name="storePicture" action="#{storePictureBean.store}"> <a:actionparam name="param1" assignTo="#{storePictureBean.src}"/> </a4j:jsFunction>And then handle adding the src to whatever context you want in the Bean.
Cheers,
Damian.