RE: How best to do a once only calculation?

Mark,
How about your xslt pre-processor idea?
It could change
 <xf:bind nodeset="Date_begun" exforms:default="now()" />
tnto your previously mentioned construct:
 <xforms:setvalue nodset="Date_begun" value="if(...,.,now())"
ev:event="xforms-model-construct-done"/>

Leigh.

-----Original Message-----
From: www-forms-request@w3.org [mailto:www-forms-request@w3.org] On
Behalf Of Mark Birbeck
Sent: Tuesday, June 06, 2006 12:12 PM
To: www-forms@w3.org
Subject: RE: How best to do a once only calculation?


Nick,

> You can for example add an even listener to your model that 
> listens for the modelconstruct-done event and use a set value 
> action to set the value.
> 
> <xforms:setvalue bind="Date_begun" value="now()" 
> ev:event="xforms-model-construct-done"/>

But Adam's question was that he didn't want the date to be repeatedly
overwritten every time he reloaded the form. That's why I likened it to
a
'default' value, since they are usually used to give an empty form
control a
value.

Of course, if using a processor that supports the conditional tests from
XForms 1.1 then you could do what you suggest, but test for 'empty'
first.

Regards,

Mark


Mark Birbeck
CEO
x-port.net Ltd.

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

Download our XForms processor from
http://www.formsPlayer.com/

Received on Tuesday, 6 June 2006 20:20:18 UTC