You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by "PALMER, THOMAS C (ATTCORP)" <TP...@att.com> on 2011/03/26 18:41:09 UTC

trouble implementing 'mutually required' validator

I've got a case (in Wicket 1.4.14) where I want to implement a 'mutually
required' validator on a FormComponent that contains a set of child form
fields.  If all are empty, it's valid.  But if any child has a value
then all become required.

 

My implementation (with the IValidator added to the parent
FormComponent) works fine if all the child fields are valid.  However,
if I add separate validators to any of the child fields and they set an
error, then my mutually required validator on the parent isn't called
since the validation process is terminated early.  This isn't desirable
since I also want the chance to set errors for any empty child fields.

 

Any suggestions?  Thanks -

 

Tom Palmer

Director, Strategic Technology Services

AT&T Hosting & Application Services | 2000 Perimeter Park Drive, Suite
140 | Morrisville, NC 27560

Office: +1 (919) 388-5937 | Mobile: +1 (919) 627-5431

thomas.palmer@att.com <ma...@att.com>  

 

Confidentiality Notice and Disclaimer: This e-mail transmission may
contain confidential and/or proprietary information of AT&T that is
intended only for the individual or entity named in the e-mail address.
If you are not the intended recipient, you are hereby notified that any
disclosure, copying, distribution, or reliance upon the contents of this
e-mail is strictly prohibited. If you have received this e-mail
transmission in error, please reply to the sender, so that AT&T can
arrange for proper delivery, and then please delete the message from
your inbox. Thank you. 

 


RE: trouble implementing 'mutually required' validator

Posted by "PALMER, THOMAS C (ATTCORP)" <TP...@att.com>.
Excellent - just return an empty list and it works like a charm.  Thanks -

-----Original Message-----
From: Martin Makundi [mailto:martin.makundi@koodaripalvelut.com] 
Sent: Saturday, March 26, 2011 1:57 PM
To: users@wicket.apache.org
Subject: Re: trouble implementing 'mutually required' validator

Try abstractformvalidator

**
Martin

2011/3/26 PALMER, THOMAS C (ATTCORP) <TP...@att.com>:
> I've got a case (in Wicket 1.4.14) where I want to implement a 'mutually
> required' validator on a FormComponent that contains a set of child form
> fields.  If all are empty, it's valid.  But if any child has a value
> then all become required.
>
>
>
> My implementation (with the IValidator added to the parent
> FormComponent) works fine if all the child fields are valid.  However,
> if I add separate validators to any of the child fields and they set an
> error, then my mutually required validator on the parent isn't called
> since the validation process is terminated early.  This isn't desirable
> since I also want the chance to set errors for any empty child fields.
>
>
>
> Any suggestions?  Thanks -
>
>
>
> Tom Palmer
>
> Director, Strategic Technology Services
>
> AT&T Hosting & Application Services | 2000 Perimeter Park Drive, Suite
> 140 | Morrisville, NC 27560
>
> Office: +1 (919) 388-5937 | Mobile: +1 (919) 627-5431
>
> thomas.palmer@att.com <ma...@att.com>
>
>
>
> Confidentiality Notice and Disclaimer: This e-mail transmission may
> contain confidential and/or proprietary information of AT&T that is
> intended only for the individual or entity named in the e-mail address.
> If you are not the intended recipient, you are hereby notified that any
> disclosure, copying, distribution, or reliance upon the contents of this
> e-mail is strictly prohibited. If you have received this e-mail
> transmission in error, please reply to the sender, so that AT&T can
> arrange for proper delivery, and then please delete the message from
> your inbox. Thank you.
>
>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: trouble implementing 'mutually required' validator

Posted by Martin Makundi <ma...@koodaripalvelut.com>.
Try abstractformvalidator

**
Martin

2011/3/26 PALMER, THOMAS C (ATTCORP) <TP...@att.com>:
> I've got a case (in Wicket 1.4.14) where I want to implement a 'mutually
> required' validator on a FormComponent that contains a set of child form
> fields.  If all are empty, it's valid.  But if any child has a value
> then all become required.
>
>
>
> My implementation (with the IValidator added to the parent
> FormComponent) works fine if all the child fields are valid.  However,
> if I add separate validators to any of the child fields and they set an
> error, then my mutually required validator on the parent isn't called
> since the validation process is terminated early.  This isn't desirable
> since I also want the chance to set errors for any empty child fields.
>
>
>
> Any suggestions?  Thanks -
>
>
>
> Tom Palmer
>
> Director, Strategic Technology Services
>
> AT&T Hosting & Application Services | 2000 Perimeter Park Drive, Suite
> 140 | Morrisville, NC 27560
>
> Office: +1 (919) 388-5937 | Mobile: +1 (919) 627-5431
>
> thomas.palmer@att.com <ma...@att.com>
>
>
>
> Confidentiality Notice and Disclaimer: This e-mail transmission may
> contain confidential and/or proprietary information of AT&T that is
> intended only for the individual or entity named in the e-mail address.
> If you are not the intended recipient, you are hereby notified that any
> disclosure, copying, distribution, or reliance upon the contents of this
> e-mail is strictly prohibited. If you have received this e-mail
> transmission in error, please reply to the sender, so that AT&T can
> arrange for proper delivery, and then please delete the message from
> your inbox. Thank you.
>
>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: trouble implementing 'mutually required' validator

Posted by shetc <sh...@bellsouth.net>.
First chapter of Igor's new book discusses validators in depth, and I think
your use case. See 
http://apache-wicket.1842946.n4.nabble.com/Apache-Wicket-Cookbook-Published-td3406012.html
http://apache-wicket.1842946.n4.nabble.com/Apache-Wicket-Cookbook-Published-td3406012.html 

--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/trouble-implementing-mutually-required-validator-tp3408020p3408353.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org