cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vilya Harvey <>
Subject ClassCastException in binding framework.
Date Wed, 07 Jul 2004 16:01:22 GMT

With the Cocoon 2.1.5 release, the binding framework throws a 
ClassCastException if you use anything other than an <fb:value> in the 
<fb:identity> part of a repeater binding. Is this intentional behaviour, or 
a bug?

The offending code comes from

  * Get the identity of the given row. That's infact a list of all the
  * values of the fields in the form model that constitute the identity.
  * @param thisRow
  * @return List the identity of the row
private List getIdentity(Repeater.RepeaterRow row) {
   List identity = new ArrayList();

   JXPathBindingBase[] childBindings =
   if (childBindings != null) {
     int size = childBindings.length;
     for (int i = 0; i < size; i++) {
       String fieldId =
       Widget widget = row.getChild(fieldId);
       Object value = widget.getValue();
   return identity;

The first line inside the for statement, which retrieves a field ID, is 
where the exception occurs. If you're using an <fb:javascript> binding to 
generate IDs dynamically, for example, the value in the childBindings array 
will be an instance of JavaScriptJXPathBinding - which cannot be cast to 

I'm guessing that the correct thing to do would be to use only methods from 
the JXPathBindingBase class to retrieve the identity values, but I can't see 
how. I'm probably overlooking something, as I'm not very familiar with the 
internals of the binding framework (yet!).

Can anyone shed any more light on this?

    o|   _. /  \|o._  _  _ ._  _  ._  _ _|_
\/ ||\/(_|| (|/||| |(/_(_)| |(/_o| |(/_ |_
      /     \__

View raw message