Hi Job,
________________________________
From: Job van Ommen [mailto:[EMAIL PROTECTED]
Sent: maandag 29 september 2008 13:39
To: [email protected]
Subject: how: XMLbinding using Cform in cocoon 2.2?
Ok, so I am new to the whole cform thing. It seems like a good
way to implement forms...BUT
I can't get it to work. I've gone through the 2.2 and 2.1
documentation but I can't get it to work.
Let's keep it simple and use the sample:
The sample from
http://cocoon.apache.org/2.2/blocks/forms/1.0/478_1_1.html doesn't use
binding.
What If i wanted to add binding and save the results to a file?
I've noticed the "simplebinding" and found the following
flowscript on the web somewhere, but It doesn't work...
Please, somebody tell me how it should be done?
-what should be in the sitemap?
-what should be in the binding xml?
-should the template or the definition als contain something
that points to the binding.xml ?
cocoon.load("servlet:forms:/resource/internal/flow/javascript/Form.js");
function registration() {
form.createBinding("cocoon://resource/internal/registration_binding.xml"
);
var form = new
Form("cocoon://resource/internal/registration_definition.xml");;
form.showForm("registration-display-pipeline");
var viewData = { "username" :
form.getChild("name").getValue() }
form.saveXML("cocoon://resource/internal/binding.xml");
cocoon.sendPage("registration-success-pipeline", viewData);
}
There is a simple XML binding example in the samples. If youve checked
out Cocoon 2.2 it's in
blocks/cocoon-forms/cocoon-forms-sample/src/main/resources/COB-INF. Have
a look at the form2simpleXML. The flowscript function is in
flow/binding_example.js.
Regards,
Jasha Joachimsthal
[EMAIL PROTECTED] - [EMAIL PROTECTED]
www.onehippo.com <http://www.onehippo.com/>
Amsterdam - Hippo B.V. Oosteinde 11 1017 WT Amsterdam +31(0)20-5224466
San Francisco - Hippo USA Inc. 101 H Street, suite Q Petaluma CA
94952-3329 +1 (707) 773-4646