Hi,

> K, I thought "handleForm" was function in the binding file. 
> But no its not there!

No, IIRC it's a function in one of the javascripts that are part of the
cocoon-forms-block.jar.

> Is it internal to cocoon?

Yes, more or less.

> And do you mean I should create a flow script?

Yes. Have a look at the forms samples, most of them are done using a flow
script to handle everything.

> > <map:match pattern="Support Form.htm">
> >   <map:call function="handleForm">
> >    <map:parameter name="function" value="form2xml"/>
> >    <map:parameter name="form-definition" 
> > value="forms/form_model.xml"/>
> >    <map:parameter name="documentURI" value="forms/form_data.xml"/>
> >    <map:parameter name="bindingURI" 
> value="forms/form_bind_xml.xml"/>
> >   </map:call>
> > </map:match>
> > ...
> > <map:match pattern="*.htm">
> >   <map:generate src="content/content.xml"/>
> >   <map:transform src="stylesheets/ui.xslt">
> >     <map:parameter name="selectedHref" value="{1}"/>
> >   </map:transform>
> >   <map:serialize type="html"/>
> > </map:match>
> > ...

I suppose this would be something like (do check the samples for the correct
syntax):

function showMyForm() {
  var formDef = cocoon.parameters["form-definition"];
  var formBind = cocoon.parameters["bindingURI"];
  var formTemplate = "a/pipeline/to/display/the/form.htm";
  var formData = cocoon.parameters["documentURI"];

  var form = new Form(formDef);
  form.createBinding(formBind);
  form.load(formData);
  form.show(formTemplate);
  form.save(formData);
  myFunctionToSaveTheData(formData);
}

HTH.

Bye, Helma

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to