Return-Path: Delivered-To: apmail-cocoon-users-archive@www.apache.org Received: (qmail 64660 invoked from network); 10 Oct 2008 15:51:46 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 10 Oct 2008 15:51:46 -0000 Received: (qmail 85720 invoked by uid 500); 10 Oct 2008 15:51:44 -0000 Delivered-To: apmail-cocoon-users-archive@cocoon.apache.org Received: (qmail 85230 invoked by uid 500); 10 Oct 2008 15:51:43 -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 85219 invoked by uid 99); 10 Oct 2008 15:51:43 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 10 Oct 2008 08:51:43 -0700 X-ASF-Spam-Status: No, hits=0.5 required=10.0 tests=DNS_FROM_SECURITYSAGE,SPF_PASS,SUBJECT_FUZZY_TION X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of solprovider@gmail.com designates 209.85.217.10 as permitted sender) Received: from [209.85.217.10] (HELO mail-gx0-f10.google.com) (209.85.217.10) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 10 Oct 2008 15:50:40 +0000 Received: by gxk3 with SMTP id 3so819116gxk.18 for ; Fri, 10 Oct 2008 08:50:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:sender :to:subject:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references :x-google-sender-auth; bh=0qnEKuJaiIYrdO+2L0wVQ3ev6wIP4Gv3a6fOrGaX8SM=; b=PZ+eofLc3o+ckZdm7NsgS3Eq1KaWtA3q7UQCp23QEPuarUqntYMRy/iLXMwWd0kbJD xDgqLPtUFa2WA8aYIicbNIAjxw3hy2obw09e+AF9P2vnrwCGD3BHWJSLhtGxQkXFIGe9 0+H4+9MVzzbNc4YscxsOaY36gGE6D4fNRKf4I= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:sender:to:subject:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references:x-google-sender-auth; b=I0uwPwBafTxO1/2eXTZLNehRRKle6rp/+IhCW3urnMx8rHx2gwCZYNfBHtJseQ/iZj cf+WR3GoCKEa/FqASJ/6y43bFcUdKtQMoYowFOiyY2o1WG0J3UIQ7HTZ7wOY77mR2EF1 MKdVlQ97hDWgiUcqin8WBbCv7kH4EpPFHjNqw= Received: by 10.142.50.5 with SMTP id x5mr856907wfx.162.1223653815267; Fri, 10 Oct 2008 08:50:15 -0700 (PDT) Received: by 10.143.32.13 with HTTP; Fri, 10 Oct 2008 08:50:15 -0700 (PDT) Message-ID: Date: Fri, 10 Oct 2008 11:50:15 -0400 From: solprovider@apache.org Sender: solprovider@gmail.com To: users@cocoon.apache.org Subject: Re: how to implement "back button functionality" from within a flow script In-Reply-To: <48ECD2D4.5CE9.00D4.0@csir.co.za> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <48ECB252.7060100@gmail.com> <48ECD2D4.5CE9.00D4.0@csir.co.za> X-Google-Sender-Auth: 2ff52896167223e3 X-Virus-Checked: Checked by ClamAV on apache.org I agree with Derek. This post pretends I am a flowscript guru. Variables persist in a continuation. Inside the loop, only update what needs updating i.e. if the list does not require updating, use the existing list. Good programming only runs what is necessary. var done = false; var key= "firstKey" var list = getList(key); do( form.showForm("myForm"); var model = form.getModel(); if(key != model.key){ key = model.key; list = getList(key); }else{ done = validate(form); } }while(!done); ANECDOTE: I once optimized a program by removing a loop for each record in a database containing a function that did nothing. 30,000 records in the TEST database = 30,000 wasted database accesses. ANECDOTE: I recently consulted on the design of a proposed application. The original design used AJAX to update dropdowns as previous dropdowns were selected. My suggestion was to make the application work using onChange submits and worry about AJAX after the application was approved. Why waste effort building an interactive UI when the company was uncertain that the base functionality was wanted? Even if the application was approved, refreshes for the onChange submits might be fast/good enough for production NOTE: AJAX allows new functionality, but breaks the BACK button. All the arguments against Flash apply. I hate pages using JavaScript functions for basic links. Most Web applications should avoid technology that prevents bookmarking and opening links into a new window/tab. (Ever want to open several menu links but the menu uses JavaScript or Flash?) HTH, solprovider On 10/8/08, Derek Hohls wrote: > Paul > > The short answer is, AFAIK, probably "no". That said, I am sure there are some > flowscript gurus who might show a way to do this with continuations? > > The right answer might be "don't" i.e. if a user has changed an item in a list, > why take him back to a previous version of the list which will not show his changes? > > An alternative longer answer might be that you need to use some clever browser-side > Javascript to manipulate the list values *inside the page it is displayed* (i.e. do not > send the user off to a new page with another form) to make it appear like an > "instant" change while, in the background, you use AJAX to send off the changed > value. Without knowing more about the specifics of where you get the data from, > where it goes to, and how it is validated etc. its not possible to flesh this out further. > > Sidebar: I have come across a number of articles recently which point out how poor > the web is for dynamic applications and yet that seems to be what we are forcing > ourselves to tackle. Square pegs in round holes? > > Derek > > >>> On 2008/10/08 at 03:14, in message <48ECB252.7060100@gmail.com>, Paul Joseph wrote: > Hi There, > > Would anyone know how from within a flowscript, I can cause the browser > to do a simple "back"? > > I have a page that contains a list and which, if the list is large can > take a minute to build. Usually the list is not big, but on occasion it is. > > When someone clicks on an item in the list, they are put into a edit > form where they can edit the contents of the list. > > When they hit save, currently, they are sent back to the list WHICH IS > REBUILT FROM SCRATCH. > > Is there anyway for me to specify in the flow script to do a "simple > back button on browser click" so that the list is NOT built from scratch. > > Thx. > Paul --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org For additional commands, e-mail: users-help@cocoon.apache.org