You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Uchenna Igwebuike <uc...@sbcglobal.net> on 2004/05/05 22:52:01 UTC

RE: CFORM Flow script global variable

Hello Mark, 

This doesn't seem to work. "OnClick" doesn't seem to be a method
available within the widget model. Is there a way I can register a js
function to handle form events within in my flowscript. I don't want to
write java form handlers. 

Thanks in advance

-----Original Message-----
From: Mark Lundquist [mailto:ml@wrinkledog.com] 
Sent: Friday, April 16, 2004 9:40 PM
To: users@cocoon.apache.org
Subject: Re: CFORM Flow script global variable


On Apr 14, 2004, at 8:22 AM, Uchenna Igwebuike wrote:

> I want to define a javascript variable within a flow script that I
want
> to use within my form event handlers. The only way I can seem to do 
> this
> is by making them global variables within the flowscript. Is there an
> alternative to this approach as it looks like these global variables 
> are
> shared across different continuation?.

In the v2 API you can do this:

	function someForm() {
		var form = new Form ("form.xml");
		var wid = form.getWidget();

		var V;
		.
		.
		.
		wid.someWidget.onClick		// or whatever event...
			= function() {
					// Here I have visibility to V,
which is
					// local to this continuation
				};
	}

Does that help?
~mark


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



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