If you use flowscript, you could look at the custom validation demo. That way you can
validate the data on the form using any logic (javascript) you wish.
If you use xsp you could use, before the map:act type=process an entry like map:transform src="stylesheets/transform-NIP-node.xsl"/>
with in transform-NIP-node.xsl something like: <xsl:match name="NIP-all"> <nip> <xsl:value-of select="NIP-part1"/>-<xsl:value-of select="NIP-part2"/> -<xsl::value-of select="NIP-part3"/>-<xsl:value-of select="NIP-prt4"/> </nip> </xsl:match>
and before the woody page is serialized you should split the nip field of course in the four parts NIP-part1 to 4. That way woody thinks there is a single field nip whereas the browser thinks there are four fields.
Extremely hacky, but if you're using xsp there is afaik not really another option as I did not see any indication that the default validation has interrelationships.
I think in such a scenario I'd use javascript/flowscript to set a validator function. That way you can totally separate the representation of the data from the logic or underlying data as you have javascript to transform the data into any format you'd wish.
This is not of much help, I realize. Sorry for that.
Leon
Sebastian wrote:
Hi there,
I've following problem. I'm using woody with binding to hibernate.
In my database I've field called NIP (it is polish rate payer
identification number). It has 4 parts separated by '-'. I've written
successfuly validation class for this number and everything works
fine. Now I would like to change the way user can modify this number.
I would like to show 4 edits instead of one and then add '-' between
them, validate NIP and then store it in database. It is exaclty opposite
to wd:aggregatefield which allows to merge several fields into single
edit. My first idea was to create 4 wd:field's but what then? How to
merge them to allow validation on whole string and what is more important
how to merge them to allow binding just to single property?
Any idea? I hope that it is not another unimplemented feature like multipage
forms. It will always remains a great mystery for me why XForms and JXForms
were deprecated when Woody is not mature enough to be the only form handler
for Cocoon.
Thanks in advance, Sebastian Gil
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
