myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From laredotornado <laredotorn...@gmail.com>
Subject RE: Only want to validate a text field if checkbox is checked ... how?
Date Wed, 18 Nov 2009 23:12:09 GMT

The attachment didn't come through (I'm looking at this forumn through
Nabble).  Could you cut and paste the relevant parts of your example into
the thread?

Thanks for the help, - Dave



Radhesh Radhakrishnan wrote:
> 
> You can use a custom phase listener trick (See the attached file)
> An f:param can be used to send the "enable / disable validation" flag.
> 
> Thank you,
> Radhesh
> 
> -----Original Message-----
> From: laredotornado [mailto:laredotornado@gmail.com] 
> Sent: Tuesday, November 17, 2009 11:27 PM
> To: users@myfaces.apache.org
> Subject: Only want to validate a text field if checkbox is checked ...
> how?
> 
> 
> Hi,
> 
> I'm using MyFaces 1.2.4, Tomahawk 1.1.9.  How do I tell JSF that I only
> want
> to apply a validator to a text field if a checkbox on the page is
> checked? 
> Right now I have this text field ...
> 
> <h:inputText id="domeTourNumAdults" value="#{domeTour.numAdults}"
>                                             required="true"
>                                             size="60"
>                                             maxlength="60"
>                                             styleClass="textFields
> numAdultsField">
>                	<f:validateLongRange minimum="0"/>
> </h:inputText>
> 
> but if a certain checkbox is not checked, I don't care if this field is
> left
> blank.  Your thoughts are appreciated, - Dave
> -- 
> View this message in context:
> http://old.nabble.com/Only-want-to-validate-a-text-field-if-checkbox-is-
> checked-...-how--tp26394554p26394554.html
> Sent from the MyFaces - Users mailing list archive at Nabble.com.
> 
> 
> 

-- 
View this message in context: http://old.nabble.com/Only-want-to-validate-a-text-field-if-checkbox-is-checked-...-how--tp26394554p26417552.html
Sent from the MyFaces - Users mailing list archive at Nabble.com.


Mime
View raw message