So you are the author of the optional validation framework?  That is
excellent.  I was reading the page but am still missing the gist of the
example.  How would you say, "If element A contains this value, then apply
this validatino rule to element B?"

Thanks, - Dave


Mike Kienenberger wrote:
> 
> required will have to be non-true.   I don't know if there's an el
> expression that will work in your case, so you might just have to
> leave it false.
> 
> The following validator works against multiple components.
> 
>     http://myfaces.apache.org/sandbox/validateCompareTo.html
> 
> You can either use it as a template for creating your own validator,
> or you might be able to use the comparator attribute on it to
> accomplish what you need.  (Force it to compare against a constant
> value of true or false instead of the inputText value).  Still not
> sure how that'd interact with  <f:validateLongRange>
> 
> You might also be able to use pieces of the OptionalValidationFramework.
> 
>     http://wiki.apache.org/myfaces/OptionalValidationFramework
> 
> 
> On Tue, Nov 17, 2009 at 12:57 PM, laredotornado <[email protected]>
> wrote:
>>
>> 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--tp26394554p26395396.html
Sent from the MyFaces - Users mailing list archive at Nabble.com.

Reply via email to