cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sylvain Wallez <sylv...@apache.org>
Subject Re: [CForms] Several forms per page?
Date Wed, 14 Sep 2005 08:02:01 GMT
Carsten Ziegeler wrote:

>The forms.lib.js contains this snippet:
>
>// Handlers that are to be called in form's "onsubmit" event
>// FIXME: this single var implies only one form per page, and needs tobe
>//       visited if we decide to support several forms per page.
>var forms_onsubmitHandlers = new Array();
>
>Now, what does this actually mean if I have several forms per page? I'm
>currently thinking of the portal having different portlets each with an
>own form.
>  
>

This feature is a provision for the case where some widget 
implementations need to perform some special actions such as copying 
some visible fields to hidden ones. The only widget implementation that 
uses it is the double listbox (see form.js/forms_createOptionTransfer) 
which could be refactored in order not to use it.

However, there has been some posts on the mailing lists showing that 
some people use it to plug in some client-side validation.

So I think we should deprecate this and replace it with a per-form 
system (i.e. attaching these handles to the form object itself). A way 
to enforce this feature isn't used in the portal is to replace the 
"push" method of the forms_onsubmitHandlers object by an alert:

  forms_onsubmitHandlers.push = function() {
    alert("You cannot use form_onsubmitHandlers in the portal") }

Sylvain

-- 
Sylvain Wallez                        Anyware Technologies
http://people.apache.org/~sylvain     http://www.anyware-tech.com
Apache Software Foundation Member     Research & Technology Director


Mime
View raw message