tags:

views:

26

answers:

1

I have a number of details about a product which I wish to display. In my db the status of these items is stored as a number eg 1 - Worldwide, 2 - Europe Only, 3 - US Only

I currently use:

<h:outputText value="#{product.value}" />

Instead of the number I would like to display an image instead. What would be the best way to go about this?

+1  A: 

Have images with filenames like status1.gif, status2.gif, status3.gif and display it as <h:graphicImage> with a "dynamic" filename as follows:

<h:graphicImage value="status#{product.value}.gif" />
BalusC
Absolutely perfect. Really simple and easy solution. Thanks for that mate
En-Motion
You're welcome. Don't forget to mark the answer accepted. See also http://stackoverflow.com/faq to learn how Stackoverflow works.
BalusC