Image Hyperlink from database - how to show image or link in jsf table?
Hi. Newb question. I have a database table with columns that have hyperlinks in the form of 'http://sun.com/image.jpg' as datavalues. I want to be able to show the image that the link refers to, in the table. In another column with links like 'http://sun.com' I want to be able to show the link as a hyperlink that will work. to open the new site.
Thanks
lvs
[382 byte] By [
lindaVS] at [2007-11-26 7:43:46]

# 1
Hi, you'll need to use two different components:
1. Hyperlink - bind your db column to the text and url properties and set the target property to the New Window (_blank) value in the drop down list in the properties sheet.
2. Image Hyperlink - bind db column to the imageURL property.
In the Table Layout dialog, you'll need to set the component type to Hyperlink and Image Hyperlink.
The Value Expression will look something like this:
#{currentRow.value['pictureURL']}
(Assuming your db table is wrapped in a data provider and the column containing the image URL is called pictureURL.
For the Hyperlink, you'll need to set the (three) properties in the properties sheet, because you can only set a default property in the Table Layout dialog. You can see the appropriate property sheet by clicking on and selecting the component in the table component in the designer.