cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeremy Quinn <jer...@apache.org>
Subject CForms : multivaluefield
Date Wed, 25 May 2005 17:50:31 GMT
Hi All,

I am using a multivaluefield and I am having strange effects.

I have a form to edit a Bean. The Bean has an ArrayList which is  
populated with a bunch of Strings. The form displays this ArrayList  
in a multivaluefield, which has all entries initially selected by  
having identical items in both the selectionlist and the Bean. You  
use the Form to deselect some of the entries.

I found that I was getting deselected (and sometimes duplicated)  
entries in the Bean after the form had been used.


What appears to be happening, is that when  
o.a.c.forms.bindingMultiValueJXPathBinding calls  
multiValueContext.removeAll(this.rowPath), not all entries are removed.

I started with a Bean that had 4 items in it's ArrayList.

I counted the items in the ArrayList either side of the call to  
removeAll :

     multiValueContext.getValue("count(" + this.rowPath + ")");

The first time it is called it reports 4, after removeAll it reports 3.

In fact removeAll in this case only ever seems to remove one entry.  
So the reason that this does not show up in the "form2_bind_bean"  
CForms Sample, appears to be that it has only 2 items in the Bean to  
start with and has validation to only allow 2 to be submitted.

Looking at  
org.apache.commons.jxpath.ri.JXPathContextReferenceImpl.removeAll I  
do not see any obvious reasons why it is not working.


Any suggestions anyone ?

Can anyone else replicate this problem ?

Or am I barking up the wrong tree ?


regards Jeremy



Mime
View raw message