Tomahawk sandbox tag library.
Tag validateCompareTo

Validates this component against another component.

Specify the foreign component with the for={foreign-component-id} attribute.

Valid operator attribute values:

If the comparator attribute is specified, the component values are compared using the specified java.util.Comparator object. If no comparator is specified, the component values must implement Comparable and are compared using compareTo(). If either value or foreign value does not implement Comparable and no Comparator is specified, validation always succeeds.

Put this validator on the bottom-most component to insure that the foreign component's value has been converted and validated first.

However, this validator will attempt to convert and validate the foreign component's value if this has not already occurred. This process may not be identical to the standard JSF conversion and validation process.

The validation error message key is currently hardcoded as

"{0} value <{1}> must be {2} {3} value <{4}>"


The alternateOperatorName attribute can specify a custom operator name. For example, use "after" instead of "greater than" when comparing dates.

The message attribute can specify an alternate validation error message key. For example, use "{0} must be {2} {3}" to remove values from the message.

Known issues:

Tag Information
Tag Classorg.apache.myfaces.custom.comparetovalidator.ValidateCompareToTag
TagExtraInfo ClassNone
Body Contentempty
Display NameNone

forfalsefalsejava.lang.StringThe JSF id of the component with which to compare values.
operatorfalsefalsejava.lang.StringOperator for comparison: equals: eq, ==, =, not equals: ne, !=, greater than: gt, >, less than: lt, <, greater than or equals: ge, >=, less than or equals: le, <=
comparatorfalsefalsejava.lang.StringValue binding for an alternate java.util.Comparator object if component values don't implement Comparable
alternateOperatorNamefalsefalsejava.lang.Stringcustom operator name in error message (ie "after" instead of "greater than" for dates)
summaryMessagefalsefalsejava.lang.Stringalternate validation error summary message format string
messagefalsefalsejava.lang.Stringalternate validation error detail message format string (use 'message' and 'detailMessage' alternatively)
detailMessagefalsefalsejava.lang.Stringalternate validation error detail message format string (use 'message' and 'detailMessage' alternatively)

No Variables Defined.

Output Generated by Tag Library Documentation Generator. Java, JSP, and JavaServer Pages are trademarks or registered trademarks of Sun Microsystems, Inc. in the US and other countries. Copyright 2002-4 Sun Microsystems, Inc. 4150 Network Circle Santa Clara, CA 95054, U.S.A. All Rights Reserved.