You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Phil Blake <ph...@sparkbc.com.au> on 2004/02/05 05:31:43 UTC

Accessing Forms from Woody Action Flow

Hi again,

I have a woody action:

<wd:action id="add" action-command="addHoliday">
	<wd:label>Add</wd:label>
	<wd:on-action>
		<javascript>
			addHoliday();
		</javascript>
	</wd:on-action>
</wd:action>


that calls addHoliday() in some flow:

function addHoliday() {
	cocoon.log.debug("adding holiday named... hmmm how do I get the form 
to find out");
	var form = ...hmmm...;
	cocoon.redirectTo("panic-can't find form in flow!");
}

I can't see this done in any of the samples - any advice?

Thanks again,

Phil

Re: Accessing Forms from Woody Action Flow

Posted by Mark Lundquist <ml...@wrinkledog.com>.
On Feb 4, 2004, at 8:31 PM, Phil Blake wrote:

> Hi again,
>
> I have a woody action:
>
> <wd:action id="add" action-command="addHoliday">
> 	<wd:label>Add</wd:label>
> 	<wd:on-action>
> 		<javascript>
> 			addHoliday();
> 		</javascript>
> 	</wd:on-action>
> </wd:action>
>
>
> that calls addHoliday() in some flow:
>
> function addHoliday() {
> 	cocoon.log.debug("adding holiday named... hmmm how do I get the form 
> to find out");


 From http://wiki.cocoondev.org/Wiki.jsp?page=WoodyEventHandling :

Javascript event listeners

Objects available in the Javascript snippet:

	• 	event: a subclass of WidgetEvent. See the woody reference 
documentation for information on the type of WidgetEvent, and see the 
javadocs for what these provide (the samples might also give a good 
start),
	• 	viewData: any "bizdata" supplied to the showForm function from 
flowscript.
	• 	if the form processing was started from a flowscript, then 
everything available from the scope of that flowscript, such as global 
variables, functions and the cocoon object (see also Flow Object Model