开发者

Display image based on number value JSF

开发者 https://www.devze.com 2023-01-17 19:14 出处:网络
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 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}" />开发者_JAVA百科

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


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" />
0

精彩评论

暂无评论...
验证码 换一张
取 消