cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeremy Quinn <jer...@apache.org>
Subject Re: RFC: Changes to CForms in 2.1.11-dev
Date Thu, 28 Dec 2006 12:01:38 GMT

On 28 Dec 2006, at 07:38, Carsten Ziegeler wrote:

> Hi Jeremy,
>
> this sounds all great to me -

cool :)

> but I can't really judge the impact of
> your suggested changes.

not until I commit anyway ;)

> But I have two questions :)
> Is it still possible to use cforms without javascript after your  
> changes?

I have not tested how cforms works without javascript for a long time  
TBH.

I do not see how my changes would effect that situation however,  
there is still a form with submit buttons, properly designed dojo  
widgets should embellish an existing form field, so just give you  
less functionality if the widget does not instantiate.

But, this is a very good point, I will do some testing here.

> And does the new stuff better support multiple forms on one page. I
> think there are some problems with the current onsubmit handlers when
> there is more than one form.

Yes, I had to change the API for adding submit handlers to allow for  
more than one form per page.

Instead of this :

	forms_onsubmitHandlers.push(handler)

You would have to do this :

	cocoon.forms.addOnSubmitHandler(formID, handler)

Each of your forms must now have a unique ID attribute (one is added  
in XSLT for you if you did not add your own).

Using this ID, I keep the list of submit handlers for each form  
separate and only call the handlers for the form being submitted.

I was looking at ways of having the Form Widget keep it's own submit  
handlers (avoiding the need for the ID parameter), but I am not sure  
it would be reliable ...... you would not be able to easily guarantee  
that the calls to add handlers were not made before the Form Widget  
had instantiated. Whereas cocoon.forms.addOnSubmitHandler is static  
so does not suffer that problem, it only needs to have been required.

I have not tested multi-form pages yet, I am sure there will be other  
issues to deal with :)

Thanks for the feedback

regards Jeremy

>
> Jeremy Quinn wrote:
>> Hi All
>>
>> I hope you all had a good Christmas.
>> Santa's little helpers have been busy working on CForms over the
>> holiday break :)
>>
>> Below is a list of changes I have in my local repo, ready to commit.
>> I would like to get feedback on these changes, in case of dissent, or
>> usecases I have not fully understood.
>>
>> 1. Updated to use Dojo 0.4.1 -- brings lots of improvements, bug
>> fixes and broader browser support.
>>
>> 2. Introduction of widget namespaces, allows lazy loading of widgets
>> via lookup from a manifest.
>>
>> 3. Dojo debugging is now turned on and off via an optional sitemap
>> parameter.
>>
>> 4. The contents of the optional <fi:init/> tag is now inserted after
>> the scripts to load dojo etc.
>>
>> 5. TODO: cocoon.forms.* to take over from forms_* in forms_lib.js.

this is done now BTW.


<snip/>

>
> -- 
> Carsten Ziegeler - Chief Architect
> http://www.s-und-n.de
> http://www.osoco.org/weblogs/rael/


Mime
View raw message