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).
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.
Sylvain
--
Sylvain Wallez Anyware Technologies
http://bluxte.net http://www.anyware-tech.com
Apache Software Foundation Member Research & Technology Director
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]