Jason Johnston wrote:

Duncan McLean wrote:

Tried to slightly refactor the registration example, and am still getting empty fields -

I added an extra start form that all it did was submit, the flow then moved on the registration page and finally the results.

Going back from the results page to the registration and a reload of the page and the data disappears as I had seen before - any ideas - apologies yet again if this is a bit trivial, but its helping my understanding! Thanks

Flow:

function registration() {
 //this just displays a simple submit form
   var form = new Form("forms/reg.xml");
   form.showForm("reg-display-pipeline");

   var form = new Form("forms/registration.xml");

   // The showForm function will keep redisplaying the form until
   // everything is valid
   form.showForm("registration-display-pipeline");

//going back from here to the previous page and a reload results in data being cleared...
   var model = form.getModel();
   var bizdata = { "username" : model.name }
   cocoon.sendPage("registration-success-pipeline.jx", bizdata);
}

(I tried creating a different form object for each page, but it didn't work). I think there's something fundamental that I'm not getting here!



I'm flying a bit blind here without trying this out, but here's what I'm guessing is happening. When you hit the back button, you're actually going back to the continuation that is created as part of the first form.showForm() loop. The script then continues from that point, exits the showForm() method, creates the registration form anew with blank values and displays it.

If you had created the registration Form before the first form.showForm() I believe you would get the behavior you expect because then that object would be reused rather than recreated.



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




Hit the nail right on the head there! Thanks again - promise that's all!

Duncan


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