You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by "Stewart, Gary" <Ga...@luht.scot.nhs.uk> on 2006/02/21 16:16:26 UTC

CForms: Global JavaScript Variables?

Hi there and sorry to bother with *yet another CForms question*,

I have a CForms form that loads an external XML document in the on-create function of the form (though the data doesn't change and therefore could be loaded in the flowscript instead if this would be easier). I parse it into a DOM tree and everything works ok. However I was wondering if there was a way of sharing this to a few objects in the form? So I could use a particular node in an output, say. Is there a way of making Javascript objects global in the context of a form? 

Also I noticed the Output document mentions using field and states to achieve the same effect. Does anyone know if there any intention on deprecating the output element later (ie should I just switch to using field instead)?

Thanks again,

Gary

*****************************************************************
The information contained in this message may be confidential or 
legally privileged and is intended for the addressee only, If you 
have received this message in error or there are any problems, 
please notify the originator immediately. The unauthorised use, 
disclosure, copying or alteration of this message is 
strictly forbidden.
*****************************************************************


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: CForms: Global JavaScript Variables?

Posted by Philippe Gassmann <ph...@anyware-tech.com>.
Have you try to set your object as a form attribute ( 
form.setAttribute("myDOM",doc); ) ?

You can then get you object by form.getAttribute("myDOM");



Stewart, Gary a écrit :

>Hi there and sorry to bother with *yet another CForms question*,
>
>I have a CForms form that loads an external XML document in the on-create function of the form (though the data doesn't change and therefore could be loaded in the flowscript instead if this would be easier). I parse it into a DOM tree and everything works ok. However I was wondering if there was a way of sharing this to a few objects in the form? So I could use a particular node in an output, say. Is there a way of making Javascript objects global in the context of a form? 
>
>Also I noticed the Output document mentions using field and states to achieve the same effect. Does anyone know if there any intention on deprecating the output element later (ie should I just switch to using field instead)?
>
>Thanks again,
>
>Gary
>
>*****************************************************************
>The information contained in this message may be confidential or 
>legally privileged and is intended for the addressee only, If you 
>have received this message in error or there are any problems, 
>please notify the originator immediately. The unauthorised use, 
>disclosure, copying or alteration of this message is 
>strictly forbidden.
>*****************************************************************
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>For additional commands, e-mail: users-help@cocoon.apache.org
>
>  
>


-- 
Philippe GASSMANN
Systèmes d'Information
ANYWARE TECHNOLOGIES
Tel : +33 (0)5 61 00 52 90
Fax : +33 (0)5 61 00 51 46
http://www.anyware-tech.com/


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org