CForms: Global JavaScript Variables?

2006-02-21 Thread Stewart, Gary
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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: CForms: Global JavaScript Variables?

2006-02-21 Thread Philippe Gassmann
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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

 




--
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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: CForms: Global JavaScript Variables?

2006-02-21 Thread Stewart, Gary

Philippe Gassmann ([EMAIL PROTECTED]) wrote:
 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);

Thanks for that. It works. Though for the achieve and additional notes you 
can't do that on the on-create as the form's on-create is called after the 
widgets (which I didn't know until now). So you could design a singleton class 
to get around that or, the solution I took, to set the widgets values using 
event.source.lookupWidget(dob).setValue(domValueForNode) in the Form 
on-create however I'm still using the suggested solution above for dynamic data 
loading.

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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]