cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Antonio Gallardo <agalla...@agssa.net>
Subject Re: ajax cform and forms_onsubmitHandlers issues
Date Thu, 08 Dec 2005 04:27:15 GMT
Quoin Developers wrote:

>So the forms_onsubmit() method needs boolean indicator as to whether
>the form has already been submitted for server processing (distinct
>from an ajax forms submission) to know whether it should process the
>onsubmit handlers array. It should no longer simply use the
>forms_onsubmtHandlers stack for that indication. When ajax is
>submitting the form, maybe it can pass an object to the
>forms_onsubmit() indicating that this is an Ajax call.
>  
>
Exaclty. The current implementation works for non-AJAX forms.

I was thinking further about this. For the AJAX mode, we need 
implemented a handler manager.

One version:
Every widget can have a method with a predefined name, then in AJAX 
mode, before commiting, the AJAX controller call this methods. We don't 
need a stack. Only a boolean indicator to keep track that the user 
already pressed a button on the page.

Another version is:
We have an stack (as we have now). But every item on the stack contains 
also the widget name to keep track of them. In AJAX mode, when the 
response comes back from the server, the AJAX controller only delete the 
methods in the stack for the widget that comes in the response. The will 
keep the methods for all the no changed widgets. That way they will be 
executed in the next submit event.

Also I will like to get rid of the "generate-id()" call in the XSLT. 
They simply don't work for AJAX.

>It would also be nice to have an object to hold all the global forms
>variables (so that we could scope them and eventually support mutliple
>forms on the same page).
>  
>
Good idea.

WDYT?

Best Regards,

Antonio Gallardo.


Mime
View raw message