I have a dropdown list of items a user can select from (the view is JSF). I would like for an image to appear on the same JSF page after a user selects an item from the dropdown list (i.e. A user select the word “Cat” from the dropdown list, and group of different cat images appear)
How would I code this in JSF?
Note* I’m using JSF 2.0 with facelets, not JSPs.
Provide a list with image URL’s in the dropdown and use
h:graphicImageto display an image on the selected URL. Then, usef:ajaxto re-render the image on change the dropdown.Here’s a kickoff example:
Bean: