Calculations and the media type

Hi all,

I have a button inside a portal, the dataprovider is set to a calculation that is supposed to return a picture, depending on the result; a greyed out button, or a ‘lit’ button. The calculation is set to the media return type.

The problem is, I cannot figure out how to return a media object! I have searched The Fine Manual and these forums and not come up with an answer, only a workaround.

return media:///AddLink.gif;
``` gives a syntax error when hitting Verify.

return ‘media:///AddLink.gif’;
return “media:///AddLink.gif”;


both display the text, media:///AddLink.gif inside the button.

return ‘’;


<IMG SRC="http://loathe.ms/~lee/rhdb-toppingbuttonhtmlbug.png">

The image does not display properly... (the button is the exact correct size for the image, when I set the imageMedia property of the button it is aligned perfectly)

How exactly are you supposed to return an image from a calculation set to return type media? I get the feeling I am missing something blatantly obvious here ...

Suggestion:

DO NOT use a portal. Use a listview in a tabpanel (without the tabs showing). This will let you have the control of a list view, and still show you what you want (like a portal).

Bob Cusick

You are setting it as a html in the button. So mediaOptions don’t apply then because the image is not rendered by the button. But through the html renderer.

If you want the image to scale then you have to do that in the img tag youreself:

<img width=50 height=50 src="media:///XXXX.GIF">