cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sylvain Wallez <>
Subject Re: [CForms] having more control over showing/processing a form
Date Wed, 11 May 2005 09:34:07 GMT
Bart Molenkamp wrote:

>Hi all,
>Currently, in flowscript, you display a form by calling
>form.showForm(uri). This function loops until the form is successfully
>processed. There is, as far as I can see, no way to get between there.
>I wonder if it would be useful to define two more functions in Form.js,
>that allow me to have better control over displaying/processing a form.
>E.g. something like:
>var form = new Form("form.xml");
>var finished = false;
>do {
>  form.showPage("form-template.xml");    // show the form only once.
>  if (user clicked some link) {
>    ...
>    // dome something else
>  } else {
>    finished = form.process();           // process the form only once.
>  }
>} while (!finished);
>In this case, I do the looping that is otherwise done in the
>form.showForm() function. But now I have more control over the form
>flow. And, form.showForm() still exists and can be built using the above
>two new methods.
>I can make this change. Would it be valuable addition for CForms, or

You can already to this without having to insert some code within the 
showForm loop (which BTW is no more a loop in 2.1.7): you can place an 
<fd:submit validate="false"> that will exit the shorForm function.

The corresponding flowscript could then look like:

var redisplayForm = true;
while(redisplayForm) {
    switch(form.submitId) {
        case "details":
        case "create":
        case "cart":
            redisplayForm = false;
        case "ok":
            redisplayForm = false;

Does it answer your need?


Sylvain Wallez                        Anyware Technologies  
Apache Software Foundation Member     Research & Technology Director

View raw message