Return-Path: Delivered-To: apmail-cocoon-users-archive@www.apache.org Received: (qmail 78584 invoked from network); 22 Jan 2006 17:59:00 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 22 Jan 2006 17:59:00 -0000 Received: (qmail 70755 invoked by uid 500); 22 Jan 2006 17:58:57 -0000 Delivered-To: apmail-cocoon-users-archive@cocoon.apache.org Received: (qmail 70737 invoked by uid 500); 22 Jan 2006 17:58:57 -0000 Mailing-List: contact users-help@cocoon.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: users@cocoon.apache.org List-Id: Delivered-To: mailing list users@cocoon.apache.org Received: (qmail 70725 invoked by uid 99); 22 Jan 2006 17:58:57 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 22 Jan 2006 09:58:57 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of duncan_mclean@blueyonder.co.uk designates 195.188.213.6 as permitted sender) Received: from [195.188.213.6] (HELO smtp-out3.blueyonder.co.uk) (195.188.213.6) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 22 Jan 2006 09:58:55 -0800 Received: from [127.0.0.1] ([82.41.77.194]) by smtp-out3.blueyonder.co.uk with Microsoft SMTPSVC(5.0.2195.6713); Sun, 22 Jan 2006 17:59:35 +0000 Message-ID: <43D3C7B9.9080800@blueyonder.co.uk> Date: Sun, 22 Jan 2006 17:58:17 +0000 From: Duncan McLean User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923) X-Accept-Language: en-us, en MIME-Version: 1.0 To: users@cocoon.apache.org Subject: Re: (Hopefully!) simple question about recalling data in field in cocoon form References: <43D3A88E.1010903@blueyonder.co.uk> <43D3B0A8.2020000@lojjic.net> <43D3B6D0.8010500@blueyonder.co.uk> <43D3BE88.6090508@lojjic.net> <43D3C2D3.1040404@blueyonder.co.uk> In-Reply-To: <43D3C2D3.1040404@blueyonder.co.uk> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 22 Jan 2006 17:59:35.0428 (UTC) FILETIME=[9ABFEC40:01C61F7D] X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Duncan McLean wrote: > Jason Johnston wrote: > >>> Imagine I have a set of form pages that are logically linked (i.e. >>> Page A -> Page B -> Page C etc which continue to some kind of final >>> processing), is it possible to present >>> a breadcrumb trail for the user, i.e. if they have completed Page A, >>> B, C,etc, can we include some kind of mechanism that will take them >>> back to any of the pages they have previously >>> filled in and be presented with their data? Will I have to bookmark >>> each continuation at each page so I can return to that particular >>> point, or is there something far simpler involved? >>> >> >> There are a few different ways to approach the multi-page form >> problem. One of them is to use a single Form object with multiple >> widget groups and use widget states to show one group at a time, >> which is demonstrated in the multipage form sample: >> http://cocoon.zones.apache.org/demos/release/samples/blocks/forms/do-multipage.flow >> >> >> If for some reason your application requires a separate Form object >> for each page, you can still accomplish the same effect, it just >> takes some more creative use of flowscript to keep all the Form >> objects around and switch between them. Off the top of my head >> something like the following should give you a start: >> >> function multipage_flow() { >> var forms = [ >> new Form("form1.xml"), >> new Form("form2.xml"), >> new Form("form3.xml") >> ]; >> var currentFormIndex = 0; >> >> var finished = false; >> while(!finished) { >> var form = forms[currentFormIndex]; >> form.showForm(...); >> switch(String(form.submitId)) { >> case "gotoNextForm": >> currentFormIndex++; break; >> case "gotoPreviousForm": >> currentFormIndex--; break; >> case "finishForm": >> finished = true; break; >> } >> } >> >> // all forms are completed, now handle the result... >> } >> >> >> >> >> >> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org >> For additional commands, e-mail: users-help@cocoon.apache.org >> >> >> >> > Jason - brilliant thanks - that gives me a great start...! > > Duncan > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org > For additional commands, e-mail: users-help@cocoon.apache.org > > > > Hi Jason 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! Cheers again Duncan --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org For additional commands, e-mail: users-help@cocoon.apache.org