cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Phil Blake <p...@sparkbc.com.au>
Subject Flow->Woody->Event->Woody... possible?
Date Wed, 14 Apr 2004 02:16:22 GMT
Hiya,

In flow I create a woody form containing a list and a remove button. It  
is shown using the form.showForm(...) method.

When the remove button is pressed a woody javascript event is triggered.

The script runs and builds a new form and again shows it using  
form.showForm()

However, the previous form is displayed. The logs show that the second  
form was created and all bindings performed, transformed and serialized  
as expected, but the the previous page is generated.

Is this something to do with continuations being created inside  
continuations?

Is it possible to have a button on a woody form trigger a "javascript  
event action" (whatever they are called) that shows another woody form?

There are no samples that I can see where this is tried. Am I going  
about it the wrong way?

Thanks,

Phil
code is here:

Original Flow:
function showFirstPage(args) {
	var form = args.form;
     var pipelineSelector = args.pipelineSelector;
     var valueForUser = getBizData();
     form.load(valueForUser);
     form.showForm(pipelineSelector);
}

Javascript Action Event - or whatever it's called:
<wd:action id="remove" action-command="removeManagedKRI">
	<wd:label>Remove</wd:label>
	<wd:on-action>
		<javascript>
			removeSelected(event.getSourceWidget().getForm());
		</javascript>
	</wd:on-action>
</wd:action>

Script called by Javascript Action Event:
function removeSelected(form) {
	var toDelete = objectsToBeDeleted(form);
	var bizData = { deleteList: toDelete };
     // Define the form
     var formDefinition = "app/formDefinition.wd";
     var bindingsDefinition = "app/managedKRI/dataExistsWarning.wb";
     var warningForm = new Form(formDefinition);
     warningForm.createBinding(bindingsDefinition);
	warningForm.load(bizData);
	warningForm.showForm("private-app-form/app/managedKRI/ 
dataExistsWarning", bizData);
}

That last line appears to run but the dataExistsWarning page is never  
returned. Rather, the previous page is returned.
Mime
View raw message