Return-Path: Delivered-To: apmail-cocoon-users-archive@www.apache.org Received: (qmail 42216 invoked from network); 21 Dec 2005 11:50:08 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 21 Dec 2005 11:50:08 -0000 Received: (qmail 63730 invoked by uid 500); 21 Dec 2005 11:50:04 -0000 Delivered-To: apmail-cocoon-users-archive@cocoon.apache.org Received: (qmail 63713 invoked by uid 500); 21 Dec 2005 11:50:03 -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 63702 invoked by uid 99); 21 Dec 2005 11:50:03 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 21 Dec 2005 03:50:03 -0800 X-ASF-Spam-Status: No, hits=1.4 required=10.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (asf.osuosl.org: 128.178.50.179 is neither permitted nor denied by domain of patrick.refondini@pobox.com) Received: from [128.178.50.179] (HELO psemail.epfl.ch) (128.178.50.179) by apache.org (qpsmtpd/0.29) with SMTP; Wed, 21 Dec 2005 03:50:02 -0800 Received: (qmail 19780 invoked from network); 21 Dec 2005 11:49:39 -0000 Received: from smartgenepc1.epfl.ch (HELO ?192.168.1.24?) (128.179.67.18) by psemail.epfl.ch with SMTP; 21 Dec 2005 11:49:39 -0000 Message-ID: <43A94152.9060704@pobox.com> Date: Wed, 21 Dec 2005 12:49:38 +0100 From: Patrick Refondini User-Agent: Mozilla Thunderbird 1.0.2 (X11/20050317) X-Accept-Language: en-us, en MIME-Version: 1.0 To: users@cocoon.apache.org Subject: Re: Forms/Flow: Control Flow Behind form.showForm() References: <501089280512200806w7c803d63j@mail.gmail.com> <43A8FF7E.3070503@pobox.com> <43A91CAC.30209@pobox.com> <43A92059.1030205@apache.org> In-Reply-To: <43A92059.1030205@apache.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Sylvain Wallez wrote: > Patrick Refondini wrote: > >> Thanks, for the quick answer! >> >> I looked at the source code available on SVN: >> http://svn.apache.org/viewcvs.cgi/*checkout*/cocoon/blocks/ >> in >> forms/trunk/java/org/apache/cocoon/forms/flow/javascript/Form.js >> >> >> Now I am going to reveal my whole Javascript incompetency: >> >> The showForm() function located in Form.js has the following signature: >> >> Form.prototype.showForm = function(uri, viewdata, ttl) { (...) } >> >> Is it the implementation for use case such as: >> >> (...) >> // Load form definition var form = new Form(formDefinition); > > > This calls the Form(...) function which then acts as a constructor. > >> // Send form to client >> form.showForm("some-pipeline.jx"); >> (...) >> >> It is not quite clear yet how Form.prototype.showForm() can be called >> Form.prototype.showForm() and how a call to >> form.showForm("some-pipeline.jx") is matched something like >> form.showForm("some-pipeline.jx", null, null) ? > > > Form.prototype.showForm attaches a function to the Form's prototype > which is then visible in objects created with "new Form(...)". This is > similar to declaring a method on a Java class. Also, JavaScript has no > notion of method overloading, but accepts variable argument lists. > Unspecified function arguments then have the value "undefined" (a JS > keyword). Thanks for this clarification. > >> Nevertheless I'll need to take a deeper look at this source code and >> try to find some Javascript tutorials ;) > > > I've you start with JavaScript, using Form.js as a tutorial is probably > a bad idea, as it's not the simplest JS you can find and makes an > advanced use of continuations to implement the form redisplay loop > without actually looping. I understand... I try to get a deeper understanding of the showForm() continuation "loop" to see when bindings to data are actually applied / reloaded in particular in the fb:simple-repeater. I have implemented a prototype "XML" editor using CForm/Binding/JX Templates with ajax enabled. Cocoon does a wonderful job to support this! My goal is to let a user insert a "Form Fragment" build from a template XML file. But I haven't been able to do it yet although I see no reason, my Cocoon understanding appart, why it should not be possible. Patrick > > Sylvain > --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org For additional commands, e-mail: users-help@cocoon.apache.org