Thursday, August 04, 2005

Native support for binding "complex" properties in Cocoon Forms

This is a good news for all those Cocoon guys.

Cocoon Forms has now a "native" support for "complex" properties and JXPath factories.
Simply implement your JXPath factory, as shown in my previous post, and configure it in you binding, without adding any other class.

Take a look at this XML snippet showing a binding example:

<fb:context xmlns:fb=""

<fb:value id="name" path="name"/>
<fb:value id="surname" path="surname"/>

<fb:context path="residence" factory="com.example.AddressFactory">
<fb:value id="street" path="street"/>


As you can see, you must configure your factory class inside a "factory" attribute of an enclosing context element;
enclosed binding elements will automatically use this factory.

For using this new feature, you have to checkout the Cocoon revision 227024 or later, from:

It is in development, but is almost stable.

Have a nice Cocoon coding!

No comments: