W3C home > Mailing lists > Public > www-forms@w3.org > September 2005

RE: How to display an image depending on an intance data value

From: Mark Birbeck <mark.birbeck@x-port.net>
Date: Tue, 20 Sep 2005 14:34:03 +0100
Message-ID: <D75A9D48-1754-4E23-A5FA-0BAA1791DB5B@S009>
To: "'Catherine Poinsignon'" <catherine.poinsignon@lombard.lu>
Cc: <www-forms@w3.org>
The technique you describe is formsPlayer only, as far as I know. It is also
quite old, and was a bit of a stop-gap; since then a much neater solution
has been proposed within the XForms Working Group, but since it involves a
change to xf:output it has been added to XForms 1.1.
The technique simply involves adding the @mediatype to xf:output:
  <xf:output value="concat('resource/images/', projectstatus, '.gif')"
    mediatype="image/*" />

This has been implemented in formsPlayer 2 -- which also allows you to
specify other media types, such as video -- and is used in the various
mapping demos (Google and Terraserver) that are described on the XForms
Wiki. A fuller description of the general technique is here:
As you'll have noticed, the key thing about this approach is that it doesn't
rely on the HTML <img> tag, which the formsPlayer 1 'stop-gap' solution
does. However, whilst I can describe the whole approach for you, I'm afraid
I don't know which other processors have impemented this feature.

Mark Birbeck
x-port.net Ltd.

e: Mark.Birbeck@x-port.net
t: +44 (0) 20 7689 9232
w: http://www.formsPlayer.com/
b: http://internet-apps.blogspot.com/

Download our XForms processor from



From: www-forms-request@w3.org [mailto:www-forms-request@w3.org] On Behalf
Of Catherine Poinsignon
Sent: 20 September 2005 13:03
To: catherine.poinsignon@lombard.lu; www-forms@w3.org
Subject: Re: How to display an image depending on an intance data value

I have tried the following solution I've found on 
http://www.codeproject.com/html/fP-and-weather-ws.asp (see step 4: Rendering
but it does not work. I see on the screen the text <img
src="resource/images/green.gif"/>, not the image itself.
Could someone confirm that this only works with formsPlayer ?
 display: block;
<xforms:output class="image" value="concat('&lt;img
I am working with Novell exteNd 5.2.1.
Thanks again,

>>> "Catherine Poinsignon" <catherine.poinsignon@lombard.lu> 20/09/2005
11:24 >>>

Hi all,
I have a model that looks like this :
 <xforms:model id="model_wsrp_rewrite_"
            <xforms:instance id="data_wsrp_rewrite_"
                <data xmlns="">
Dependiing on the value of projectstatus, I want to display an image :
if projectstatus = "green", the image source is "images/green.gif"
if projectstatus = "red", the image source is "images/red.gif"
How can I do that in xFroms ?
Thanks in advance,
Received on Tuesday, 20 September 2005 13:35:10 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:36:15 UTC