Stephan Coboos wrote:
Hello,
I need to implement a wizard using CForms. For this I had created one form definition which contains all fields of all wizards. Within the flowscript I only create one form instance for all shows. Each wizard form will contain a subset of fields of the form definition. At the end of the wizard trip I want to get all datas into one model. My flowscript looks something like this:
function foo {
var form = new Form("form.xml");
form.showForm("wizardStep1");
// Do something here
form.showForm("wizardStep2");
var model = form.getModel();
// Do something with model here
// Send ok page cocoon.sendPageAndWait("ok.html"); }
But this doesn't work. The first wizard will be shown and the second one, too. But after filling out and sending the second form cocoon will allways display the second wizard and not go to the ok.html page. Isn't it possible to make several calls of showForm on one instance? Whats wrong here? Is this a known problem?
Yup, this is a know problem if your form contains required fields, as you won't exit a form.showForm until the form is valid, i.e. all required fields have a value. And they may not be present on the page you display...
Sylvain
-- Sylvain Wallez Anyware Technologies http://www.apache.org/~sylvain http://www.anyware-tech.com { XML, Java, Cocoon, OpenSource }*{ Training, Consulting, Projects }