cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stefan Klein" <>
Subject limitation in woody-repeater binding and collections
Date Tue, 02 Mar 2004 14:57:49 GMT
here's an issue I came across the other day and it took me quite a while to figure out, so
I thought 
I'd let everyone know and maybe someone could include a note in the WoodyBinding 
documentation on the wiki: 
I had a bean with a Collection of type HashSet which I was trying to bind to a Woody Form.

Reading it worked perfectly, updating, too. But inserting a couple of new elements at a time

caused a problem: The binding seemed to save only some elements and create empty collection

elements (no values set) for others. 
Tracing the problem through the woody code, I realised that the code implies the use of ordered

collections such as LinkedList, ArrayList...  
Woody first creates a new element instance and adds it to the collection. It then obtains
it from 
the collection using jxpath syntax "mybean/collection[count]" to fill in the values. "count"
is the 
new number of elements in the collection (after insertion) which assumes that the new element

has been added at the end. This is true for Lists, but not for my HashSet. So, in fact, any
element would be retrieved, possibly the new one and possibly not. That produced an 
unpredictable behaviour where element values would be overwritten and others left blank. 
Maybe that could be pointed out more clearly on the wiki page where it only says that the
has to be of type Collection. Might save others some time. 
Nachrichten, Musik und Spiele schnell und einfach per Quickstart im 
WEB.DE Screensaver - Gratis downloaden:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message