W3C home > Mailing lists > Public > www-forms@w3.org > June 2006

Re: How best to do a once only calculation?

From: <Nick_Van_den_Bleeken@inventivedesigners.com>
Date: Tue, 6 Jun 2006 20:54:11 +0200
To: "Flinton Adam" <Adam.Flinton@cfh.nhs.uk>
Cc: www-forms@w3.org
Message-ID: <OFC0E5E081.50565CFF-ONC1257185.005697CD-C1257185.0067D48A@inventivedesigners.com>

Hi Adam,

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"/>

Kind regards,

Nick Van den Bleeken  -  Research & Development
Inventive Designers
Phone: +32 - 3 - 8210170
Fax: +32 - 3 - 8210171
Email: Nick_Van_den_Bleeken@inventivedesigners.com

www-forms-request@w3.org wrote on 06/06/2006 05:09:05 PM:

> 
> We have a need to put in a date generated when you construct the form as
> such I have looked at
> 
> <xforms:bind nodeset="Date_begun" id="Date_begun" type="xsd:dateTime"
> calculate="now()" />
> 
> However rather obviously it will do this everytime I open this
> element/form.
> 
> We have an element which can carry a value which we are using to denote
> if something is new (i.e. should have the date now() generated) or
> already existing i.e. it should be left as is.
> 
> 
> Any ideas?
> 
> TIA
> 
> 
> Adam
> 
> This e-mail is confidential and privileged. If you are not the 
> intended recipient please accept our apologies; please do not 
> disclose, copy or distribute information in this e-mail or take any 
> action in reliance on its contents: to do so is strictly prohibited 
> and may be unlawful. Please inform us that this message has gone 
> astray before deleting it. Thank you for your co-operation.
> 
> 
> 



--------------------------------------------------

Inventive Designers' Email Disclaimer:

http://www.inventivedesigners.com/email-disclaimer
Received on Tuesday, 6 June 2006 18:54:29 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Saturday, 10 March 2012 06:22:05 GMT