Selecting an image asset from data mapping

I have a REST service which returns documents, including the file type. Say the type can ben PDF or XML. I would like to display an image icon showing the file type.

I have uploaded two image assets and named one pdf.png and the other xml.png. I have mapped the service property file-format to the image asset and use the following custom javascript:

return "image/" + value + ".png";

Although this seems to be working OK (when I check the source, the src property of the image is changed to image/pdf.png), the image won't display. It looks the image URL starts with http://tiggzi.com/views/.... and the html is in http://tiggzi.com/view/.

What should I do?
1 person has
this question
+1
This topic is no longer open for comments or replies.