cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Simone Gianni (JIRA)" <>
Subject [jira] Created: (COCOON-1801) [PATCH] Repeater events
Date Sat, 18 Mar 2006 02:04:11 GMT
[PATCH] Repeater events

         Key: COCOON-1801
     Project: Cocoon
        Type: New Feature
  Components: Blocks: Forms  
    Versions: 2.1.9-dev (current SVN)    
    Reporter: Simone Gianni
 Attachments: repeaterlistener-sample.diff, repeaterlistener.diff

Since I felt the need and there are many comments in the code about it, i've implemented a
RepeaterListener. The listener is triggered on row addition, deletion, reordering and clear.
The event also brings informations about the row index and the actual action that took place.

I've adapted the javascript listener to support this new listener, and in the meanwhile also
noticed that lines 59 to 70 of it are useless, since i believe that code has been moved inside
the JavaScriptHelper methods and those lines were left there.

I've added a sample in form1, in the contact repeater. It's better to use the flow version
of the sample, since in the no-flow sample the repeater is always recreated, an all events
are broadcasted again.

The usage is simply :

I took care to call the event after the row has been initalized and to provide two events
(deleting and deleted) for row deletion, so that accessing the new or "about to be deleted"
row inside the listener should not be a problem. The forms1.xml listener has an example on
how to do this.

The only place where i'm not sure this will always work correctly is inside the initialize
method, maybe the event broadcast should be moved to somewhere else, or at least after the
super.initialize() call, just to make sure that when the listener gets the event everything
is properly set up.

Please note that the patch includes modifications on the javascript listener (*)
which i already modified in COCOON-1781. Regarding this file this patch will conflict with
the other one (since both contains the same modifications) and in part superseedes the other
one (due to the lines i've removed). So please apply the COCOON-1781 first, then this one,
and if having problems applying this one revert the o.a.c.forms.event.impl.JavaScript* classes
and then retry.

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
For more information on JIRA, see:

View raw message