The same trick with deferred method execution would do the trick,
 
http://article.gmane.org/gmane.comp.java.tapestry.user/19946/match=ignatyev+submit
 or simply set ID of the element to delete in the listener but perform actual 
deletion in the onSubmit method of the form.
 

isaac n <[EMAIL PROTECTED]> wrote: Hello everyone,

I have a @For component that's based on a list of objects. The @For
component is set up with "delete" buttons for each row, so that clicking the
button deletes that row.

The problem is, after the Delete button's listener gets called, Tapestry
throws a ConcurrentModificationException.  I dug deeper and noticed that the
ForBean (which underlies @For) is using an iterator which was created before
the element was removed from the list -- which is what causes the exception.

I imagine this is a common issue, since it should be possible to remove
elements from a @For component without breaking it. Is there a standard
solution to this problem?

Thanks!




Konstantin Ignatyev




PS: If this is a typical day on planet earth, humans will add fifteen million 
tons of carbon to the atmosphere, destroy 115 square miles of tropical 
rainforest, create seventy-two miles of desert, eliminate between forty to one 
hundred species, erode seventy-one million tons of topsoil, add 2,700 tons of 
CFCs to the stratosphere, and increase their population by 263,000

Bowers, C.A.  The Culture of Denial:  Why the Environmental Movement Needs a 
Strategy for Reforming Universities and Public Schools.  New York:  State 
University of New York Press, 1997: (4) (5) (p.206)

Reply via email to