cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Joseph <>
Subject aggregate field with optional values
Date Tue, 28 Dec 2004 13:57:47 GMT

I have a "simple" aggregate field made up of three
parts, and would like to make filling of any of these
parts optional to the user.

Since I would like the user to be able to type in
almost anything in each part, I have made the
separator a combination that they are fairly unlikely
to type.

My model is as follows:

<fd:aggregatefield id="requestaggregate"
<fd:datatype base="string"/>
<fd:split pattern="(.*)?-_-(.*)?-_-(.*)?">
<fd:map group="1" field="part1"/>
<fd:map group="2" field="part2"/>
<fd:map group="3" field="part3"/>
<fd:combine expression = 'Concat(part1, "-_-", part2,
"-_-", part3)'/>
<fd:field id="part1" required="false">
<fd:datatype base="string"/>
<fd:field id="part2" required="false">
<fd:datatype base="string"/>
<fd:field id="part3" required="false">
<fd:datatype base="string"/>

I find that it either requires all the parts to be
filled or none of the parts. 

If I leave one part unfilled, then it will not save to
the database, because I think it is not passing some
validation even though I have requested no validation.

If I delete from the database any one of the parts,
then the form populates correctly, leading me to think
that the problem is not with the "split pattern" but
with the "combine expression" line:

<fd:combine expression = 'Concat(part1, "-_-", part2,
"-_-", part3)'/>

This does not appear to work/validate when part1 or
part2 or part3 is blank.

Any help would be much appreciated!


This communication, including attachments, is for the exclusive use of 
the addressee and may contain proprietary, confidential, or privileged
information.  If you are not the intended recipient, any use, copying,
disclosure, dissemination, or distribution is strictly prohibited.  If 
you are not the intended recipient, please notify the sender by return mail and delete this
communication and destroy all copies.

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

View raw message