The validate method has the following signature:

 

public void validate(FacesContext facesContext, UIComponent uiComponent, Object value) throws ValidatorException;

 

Does this mandate that any validator component needs to have a component which will then become the parent?

 


From: Madhav Bhargava [mailto:[EMAIL PROTECTED]
Sent: Friday, November 10, 2006 6:48 PM
To: MyFaces Discussion
Subject: RE: custom validator exception

 

I saw the usage of validateEquals – I have a question (it might be a stupid one)

 

Documented usage of this component:

<h:inputText id="equal2"
                value="#{validateForm.equal2}"
                required="true">
    <t:validateEqual for="" />
</h:inputText>

 

Why is the validator component enclosed in an inputText component?

 

Since this validator is not going to validate the parent component anyways, then why not just place it at the same level as the component it is going to validate. In the validate method get the ViewRoot and find the component with the ID that is already passed into the validator component.

 

Could you provide some insights?

 

Thanks

madhav

 


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Matthias Wessendorf
Sent: Friday, November 10, 2006 5:48 PM
To: MyFaces Discussion
Subject: Re: custom validator exception

 

the error says the component you nest it is no ValueHolder.
not related to the validator.

inside of tomahawk there is a similar validator. <t:validateEquals /> check that code and *convert* the logic to your use case.
Trinidad has also two validators for dates (dateRange and dateRestriction)

Greetz,
Matthias

**************** CAUTION - Disclaimer *****************
This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely for the use of the addressee(s). If you are not the intended recipient, please notify the sender by e-mail and delete the original message. Further, you are not to copy, disclose, or distribute this e-mail or its contents to any other person and any such actions are unlawful. This e-mail may contain viruses. Infosys has taken every reasonable precaution to minimize this risk, but is not liable for any damage you may sustain as a result of any virus in this e-mail. You should carry out your own virus checks before opening the e-mail or attachment. Infosys reserves the right to monitor and review the content of all messages sent to or from this e-mail address. Messages sent to or from this e-mail address may be stored on the Infosys e-mail system.
***INFOSYS******** End of Disclaimer ********INFOSYS***

Reply via email to