You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Mijo Repusic <mi...@repusic.com> on 2007/05/13 10:49:14 UTC
interrupt validation
Hi
I have build a custom validator with java which should simulate the
required attribute of a widget. If certain rules apply the widget must
have a value or else a validation error is shown. This works fine. The
problem lies in the other „normal“ validations. I somehow want the
validation to stop, if my custom validator sees it fit. I tried to place
a workaround by using widget.setValue(null) – so the other validations
would only see an empty widget and always return true -, but this
somehow throws my program in an endless loop and everything goes
horrible wrong.
I find this irritating because the method widget.getValue() can return
null. If one can get null, one should be able to set it :)
<fd:validation>
<fd:java class="com.mycompany.validators.MyCustomValidator">
<fd:failmessage>This field should not be empty!</fd:failmessage>
</fd:java>
<!-- the validation should stop at this point -->
<fd:email>
<fd:failmessage>Not a valid email address!</fd:failmessage>
</fd:email>
....
</fd:validation>
mijo
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org