myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gpetra...@apache.org
Subject svn commit: r981768 - in /myfaces/extensions/validator/branches/branch_for_jsf_2_0/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/crossval: annotation/ strategy/
Date Tue, 03 Aug 2010 07:47:49 GMT
Author: gpetracek
Date: Tue Aug  3 07:47:49 2010
New Revision: 981768

URL: http://svn.apache.org/viewvc?rev=981768&view=rev
Log:
EXTVAL-112 first draft

Added:
    myfaces/extensions/validator/branches/branch_for_jsf_2_0/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/crossval/annotation/MessageTarget.java
Modified:
    myfaces/extensions/validator/branches/branch_for_jsf_2_0/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/crossval/annotation/DateIs.java
    myfaces/extensions/validator/branches/branch_for_jsf_2_0/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/crossval/annotation/EmptyIf.java
    myfaces/extensions/validator/branches/branch_for_jsf_2_0/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/crossval/annotation/Equals.java
    myfaces/extensions/validator/branches/branch_for_jsf_2_0/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/crossval/annotation/NotEquals.java
    myfaces/extensions/validator/branches/branch_for_jsf_2_0/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/crossval/annotation/RequiredIf.java
    myfaces/extensions/validator/branches/branch_for_jsf_2_0/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/crossval/strategy/AbstractCompareStrategy.java
    myfaces/extensions/validator/branches/branch_for_jsf_2_0/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/crossval/strategy/DateIsStrategy.java
    myfaces/extensions/validator/branches/branch_for_jsf_2_0/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/crossval/strategy/EmptyIfStrategy.java
    myfaces/extensions/validator/branches/branch_for_jsf_2_0/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/crossval/strategy/EqualsStrategy.java
    myfaces/extensions/validator/branches/branch_for_jsf_2_0/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/crossval/strategy/NotEqualsStrategy.java
    myfaces/extensions/validator/branches/branch_for_jsf_2_0/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/crossval/strategy/RequiredIfStrategy.java

Modified: myfaces/extensions/validator/branches/branch_for_jsf_2_0/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/crossval/annotation/DateIs.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/branches/branch_for_jsf_2_0/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/crossval/annotation/DateIs.java?rev=981768&r1=981767&r2=981768&view=diff
==============================================================================
--- myfaces/extensions/validator/branches/branch_for_jsf_2_0/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/crossval/annotation/DateIs.java
(original)
+++ myfaces/extensions/validator/branches/branch_for_jsf_2_0/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/crossval/annotation/DateIs.java
Tue Aug  3 07:47:49 2010
@@ -51,6 +51,8 @@ public @interface DateIs
 
     String validationErrorMsgKey() default "";
 
+    MessageTarget validationErrorMsgTarget() default MessageTarget.target;
+
     String notBeforeErrorMsgKey() default "wrong_date_not_before";
 
     String notAfterErrorMsgKey() default "wrong_date_not_after";
@@ -60,4 +62,4 @@ public @interface DateIs
     int errorMessageDateStyle() default DateFormat.MEDIUM;
 
     Class<? extends ValidationParameter>[] parameters() default ViolationSeverity.Error.class;
-}
\ No newline at end of file
+}

Modified: myfaces/extensions/validator/branches/branch_for_jsf_2_0/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/crossval/annotation/EmptyIf.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/branches/branch_for_jsf_2_0/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/crossval/annotation/EmptyIf.java?rev=981768&r1=981767&r2=981768&view=diff
==============================================================================
--- myfaces/extensions/validator/branches/branch_for_jsf_2_0/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/crossval/annotation/EmptyIf.java
(original)
+++ myfaces/extensions/validator/branches/branch_for_jsf_2_0/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/crossval/annotation/EmptyIf.java
Tue Aug  3 07:47:49 2010
@@ -49,5 +49,7 @@ public @interface EmptyIf
 
     String validationErrorMsgKey() default "field_not_empty";
 
+    MessageTarget validationErrorMsgTarget() default MessageTarget.source;
+
     Class<? extends ValidationParameter>[] parameters() default ViolationSeverity.Error.class;
 }

Modified: myfaces/extensions/validator/branches/branch_for_jsf_2_0/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/crossval/annotation/Equals.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/branches/branch_for_jsf_2_0/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/crossval/annotation/Equals.java?rev=981768&r1=981767&r2=981768&view=diff
==============================================================================
--- myfaces/extensions/validator/branches/branch_for_jsf_2_0/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/crossval/annotation/Equals.java
(original)
+++ myfaces/extensions/validator/branches/branch_for_jsf_2_0/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/crossval/annotation/Equals.java
Tue Aug  3 07:47:49 2010
@@ -44,5 +44,7 @@ public @interface Equals
 
     String validationErrorMsgKey() default "duplicated_content_required";
 
+    MessageTarget validationErrorMsgTarget() default MessageTarget.both;
+
     Class<? extends ValidationParameter>[] parameters() default ViolationSeverity.Error.class;
 }
\ No newline at end of file

Added: myfaces/extensions/validator/branches/branch_for_jsf_2_0/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/crossval/annotation/MessageTarget.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/branches/branch_for_jsf_2_0/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/crossval/annotation/MessageTarget.java?rev=981768&view=auto
==============================================================================
--- myfaces/extensions/validator/branches/branch_for_jsf_2_0/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/crossval/annotation/MessageTarget.java
(added)
+++ myfaces/extensions/validator/branches/branch_for_jsf_2_0/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/crossval/annotation/MessageTarget.java
Tue Aug  3 07:47:49 2010
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.myfaces.extensions.validator.crossval.annotation;
+
+import org.apache.myfaces.extensions.validator.internal.UsageInformation;
+import org.apache.myfaces.extensions.validator.internal.UsageCategory;
+
+/**
+ * @author Gerhard Petracek
+ * @since r4
+ */
+@UsageInformation(UsageCategory.API)
+public enum MessageTarget
+{
+    source, target, both
+}

Modified: myfaces/extensions/validator/branches/branch_for_jsf_2_0/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/crossval/annotation/NotEquals.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/branches/branch_for_jsf_2_0/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/crossval/annotation/NotEquals.java?rev=981768&r1=981767&r2=981768&view=diff
==============================================================================
--- myfaces/extensions/validator/branches/branch_for_jsf_2_0/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/crossval/annotation/NotEquals.java
(original)
+++ myfaces/extensions/validator/branches/branch_for_jsf_2_0/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/crossval/annotation/NotEquals.java
Tue Aug  3 07:47:49 2010
@@ -44,5 +44,7 @@ public @interface NotEquals
 
     String validationErrorMsgKey() default "duplicated_content_denied";
 
+    MessageTarget validationErrorMsgTarget() default MessageTarget.both;
+
     Class<? extends ValidationParameter>[] parameters() default ViolationSeverity.Error.class;
 }
\ No newline at end of file

Modified: myfaces/extensions/validator/branches/branch_for_jsf_2_0/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/crossval/annotation/RequiredIf.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/branches/branch_for_jsf_2_0/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/crossval/annotation/RequiredIf.java?rev=981768&r1=981767&r2=981768&view=diff
==============================================================================
--- myfaces/extensions/validator/branches/branch_for_jsf_2_0/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/crossval/annotation/RequiredIf.java
(original)
+++ myfaces/extensions/validator/branches/branch_for_jsf_2_0/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/crossval/annotation/RequiredIf.java
Tue Aug  3 07:47:49 2010
@@ -50,5 +50,7 @@ public @interface RequiredIf
 
     String validationErrorMsgKey() default "empty_field";
 
+    MessageTarget validationErrorMsgTarget() default MessageTarget.source;
+
     Class<? extends ValidationParameter>[] parameters() default ViolationSeverity.Error.class;
 }
\ No newline at end of file

Modified: myfaces/extensions/validator/branches/branch_for_jsf_2_0/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/crossval/strategy/AbstractCompareStrategy.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/branches/branch_for_jsf_2_0/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/crossval/strategy/AbstractCompareStrategy.java?rev=981768&r1=981767&r2=981768&view=diff
==============================================================================
--- myfaces/extensions/validator/branches/branch_for_jsf_2_0/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/crossval/strategy/AbstractCompareStrategy.java
(original)
+++ myfaces/extensions/validator/branches/branch_for_jsf_2_0/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/crossval/strategy/AbstractCompareStrategy.java
Tue Aug  3 07:47:49 2010
@@ -31,6 +31,10 @@ import javax.faces.validator.ValidatorEx
 
 import org.apache.myfaces.extensions.validator.crossval.storage.CrossValidationStorage;
 import org.apache.myfaces.extensions.validator.crossval.storage.CrossValidationStorageEntry;
+import org.apache.myfaces.extensions.validator.crossval.annotation.MessageTarget;
+import static org.apache.myfaces.extensions.validator.crossval.annotation.MessageTarget.source;
+import static org.apache.myfaces.extensions.validator.crossval.annotation.MessageTarget.both;
+import static org.apache.myfaces.extensions.validator.crossval.annotation.MessageTarget.target;
 import org.apache.myfaces.extensions.validator.util.ClassUtils;
 import org.apache.myfaces.extensions.validator.util.ExtValUtils;
 import org.apache.myfaces.extensions.validator.core.ExtValContext;
@@ -286,16 +290,26 @@ public abstract class AbstractCompareStr
         return entryOfTarget != null && entryOfTarget.getComponent() != null;
     }
 
+    @Deprecated
     protected boolean handleSourceViolation(CrossValidationStorageEntry entryOfSource)
     {
-        return true;
+        return useSourceComponentToDisplayErrorMsg(entryOfSource);
     }
 
-    protected boolean useTargetComponentToDisplayErrorMsg(CrossValidationStorageEntry crossValidationStorageEntry)
+    protected boolean useSourceComponentToDisplayErrorMsg(CrossValidationStorageEntry entryOfSource)
     {
-        return handleTargetViolation(crossValidationStorageEntry, null);
+        MessageTarget messageTarget = getMessageTarget((A)entryOfSource.getMetaDataEntry().getValue());
+        return messageTarget.equals(source) || messageTarget.equals(both);
     }
 
+    protected boolean useTargetComponentToDisplayErrorMsg(CrossValidationStorageEntry entryOfSource)
+    {
+        MessageTarget messageTarget = getMessageTarget((A)entryOfSource.getMetaDataEntry().getValue());
+        return messageTarget.equals(target) || messageTarget.equals(both);
+    }
+
+    protected abstract MessageTarget getMessageTarget(A annotation);
+
     /*
      * no target component (validation against the model) -> get reverse message for source
component
      */

Modified: myfaces/extensions/validator/branches/branch_for_jsf_2_0/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/crossval/strategy/DateIsStrategy.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/branches/branch_for_jsf_2_0/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/crossval/strategy/DateIsStrategy.java?rev=981768&r1=981767&r2=981768&view=diff
==============================================================================
--- myfaces/extensions/validator/branches/branch_for_jsf_2_0/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/crossval/strategy/DateIsStrategy.java
(original)
+++ myfaces/extensions/validator/branches/branch_for_jsf_2_0/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/crossval/strategy/DateIsStrategy.java
Tue Aug  3 07:47:49 2010
@@ -18,9 +18,9 @@
  */
 package org.apache.myfaces.extensions.validator.crossval.strategy;
 
-import org.apache.myfaces.extensions.validator.crossval.storage.CrossValidationStorageEntry;
 import org.apache.myfaces.extensions.validator.crossval.annotation.DateIs;
 import org.apache.myfaces.extensions.validator.crossval.annotation.DateIsType;
+import org.apache.myfaces.extensions.validator.crossval.annotation.MessageTarget;
 import org.apache.myfaces.extensions.validator.baseval.annotation.SkipValidationSupport;
 import org.apache.myfaces.extensions.validator.internal.UsageInformation;
 import org.apache.myfaces.extensions.validator.internal.UsageCategory;
@@ -46,18 +46,9 @@ public class DateIsStrategy extends Abst
     protected static final String COMPARED_VALUE_KEY = "target value";
     protected static final String REVERSE_COMPARED_VALUE_KEY = "reverse target value";
 
-    @Override
-    public boolean useTargetComponentToDisplayErrorMsg(
-            CrossValidationStorageEntry crossValidationStorageEntry)
-    {
-        return true;
-    }
-
-    //TODO test & remove
-    @Override
-    protected boolean handleSourceViolation(CrossValidationStorageEntry entryOfSource)
+    protected MessageTarget getMessageTarget(DateIs annotation)
     {
-        return false;
+        return annotation.validationErrorMsgTarget();
     }
 
     public boolean isViolation(Object object1, Object object2, DateIs annotation)

Modified: myfaces/extensions/validator/branches/branch_for_jsf_2_0/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/crossval/strategy/EmptyIfStrategy.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/branches/branch_for_jsf_2_0/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/crossval/strategy/EmptyIfStrategy.java?rev=981768&r1=981767&r2=981768&view=diff
==============================================================================
--- myfaces/extensions/validator/branches/branch_for_jsf_2_0/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/crossval/strategy/EmptyIfStrategy.java
(original)
+++ myfaces/extensions/validator/branches/branch_for_jsf_2_0/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/crossval/strategy/EmptyIfStrategy.java
Tue Aug  3 07:47:49 2010
@@ -20,12 +20,18 @@ package org.apache.myfaces.extensions.va
 
 import org.apache.myfaces.extensions.validator.crossval.annotation.EmptyIf;
 import org.apache.myfaces.extensions.validator.crossval.annotation.EmptyIfType;
+import org.apache.myfaces.extensions.validator.crossval.annotation.MessageTarget;
 
 /**
  * @author Rudy De Busscher
  */
 public class EmptyIfStrategy extends AbstractCompareStrategy<EmptyIf>
 {
+    protected MessageTarget getMessageTarget(EmptyIf annotation)
+    {
+        return annotation.validationErrorMsgTarget();
+    }
+
     @Override
     protected String getValidationErrorMsgKey(EmptyIf annotation, boolean isTargetComponent)
     {

Modified: myfaces/extensions/validator/branches/branch_for_jsf_2_0/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/crossval/strategy/EqualsStrategy.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/branches/branch_for_jsf_2_0/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/crossval/strategy/EqualsStrategy.java?rev=981768&r1=981767&r2=981768&view=diff
==============================================================================
--- myfaces/extensions/validator/branches/branch_for_jsf_2_0/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/crossval/strategy/EqualsStrategy.java
(original)
+++ myfaces/extensions/validator/branches/branch_for_jsf_2_0/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/crossval/strategy/EqualsStrategy.java
Tue Aug  3 07:47:49 2010
@@ -22,8 +22,8 @@ import org.apache.myfaces.extensions.val
 import org.apache.myfaces.extensions.validator.core.validation.EmptyValueAwareValidationStrategy;
 import org.apache.myfaces.extensions.validator.core.validation.NullValueAwareValidationStrategy;
 import org.apache.myfaces.extensions.validator.crossval.annotation.Equals;
+import org.apache.myfaces.extensions.validator.crossval.annotation.MessageTarget;
 import org.apache.myfaces.extensions.validator.crossval.parameter.CaseInsensitive;
-import org.apache.myfaces.extensions.validator.crossval.storage.CrossValidationStorageEntry;
 import org.apache.myfaces.extensions.validator.internal.UsageCategory;
 import org.apache.myfaces.extensions.validator.internal.UsageInformation;
 import org.apache.myfaces.extensions.validator.util.ExtValUtils;
@@ -40,10 +40,9 @@ import java.lang.annotation.Annotation;
 @UsageInformation(UsageCategory.INTERNAL)
 public class EqualsStrategy extends AbstractCompareStrategy
 {
-    @Override
-    public boolean useTargetComponentToDisplayErrorMsg(CrossValidationStorageEntry crossValidationStorageEntry)
+    protected MessageTarget getMessageTarget(Annotation annotation)
     {
-        return true;
+        return ((Equals) annotation).validationErrorMsgTarget();
     }
 
     protected String getValidationErrorMsgKey(Annotation annotation, boolean isTargetComponent)
@@ -74,4 +73,4 @@ public class EqualsStrategy extends Abst
                 .extract(annotation, ExtValUtils.getValidationParameterClassFor(CaseInsensitive.class))
                 .iterator().hasNext();
     }
-}
\ No newline at end of file
+}

Modified: myfaces/extensions/validator/branches/branch_for_jsf_2_0/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/crossval/strategy/NotEqualsStrategy.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/branches/branch_for_jsf_2_0/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/crossval/strategy/NotEqualsStrategy.java?rev=981768&r1=981767&r2=981768&view=diff
==============================================================================
--- myfaces/extensions/validator/branches/branch_for_jsf_2_0/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/crossval/strategy/NotEqualsStrategy.java
(original)
+++ myfaces/extensions/validator/branches/branch_for_jsf_2_0/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/crossval/strategy/NotEqualsStrategy.java
Tue Aug  3 07:47:49 2010
@@ -19,6 +19,7 @@
 package org.apache.myfaces.extensions.validator.crossval.strategy;
 
 import org.apache.myfaces.extensions.validator.crossval.annotation.NotEquals;
+import org.apache.myfaces.extensions.validator.crossval.annotation.MessageTarget;
 import org.apache.myfaces.extensions.validator.baseval.annotation.SkipValidationSupport;
 import org.apache.myfaces.extensions.validator.internal.UsageInformation;
 import org.apache.myfaces.extensions.validator.internal.UsageCategory;
@@ -38,6 +39,12 @@ import java.lang.annotation.Annotation;
 public class NotEqualsStrategy extends EqualsStrategy
 {
     @Override
+    protected MessageTarget getMessageTarget(Annotation annotation)
+    {
+        return ((NotEquals) annotation).validationErrorMsgTarget();
+    }
+
+    @Override
     protected String getValidationErrorMsgKey(Annotation annotation, boolean isTargetComponent)
     {
         return ((NotEquals) annotation).validationErrorMsgKey();

Modified: myfaces/extensions/validator/branches/branch_for_jsf_2_0/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/crossval/strategy/RequiredIfStrategy.java
URL: http://svn.apache.org/viewvc/myfaces/extensions/validator/branches/branch_for_jsf_2_0/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/crossval/strategy/RequiredIfStrategy.java?rev=981768&r1=981767&r2=981768&view=diff
==============================================================================
--- myfaces/extensions/validator/branches/branch_for_jsf_2_0/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/crossval/strategy/RequiredIfStrategy.java
(original)
+++ myfaces/extensions/validator/branches/branch_for_jsf_2_0/validation-modules/property-validation/src/main/java/org/apache/myfaces/extensions/validator/crossval/strategy/RequiredIfStrategy.java
Tue Aug  3 07:47:49 2010
@@ -21,6 +21,7 @@ package org.apache.myfaces.extensions.va
 import org.apache.myfaces.extensions.validator.crossval.storage.CrossValidationStorageEntry;
 import org.apache.myfaces.extensions.validator.crossval.annotation.RequiredIf;
 import org.apache.myfaces.extensions.validator.crossval.annotation.RequiredIfType;
+import org.apache.myfaces.extensions.validator.crossval.annotation.MessageTarget;
 import org.apache.myfaces.extensions.validator.baseval.annotation.SkipValidationSupport;
 import org.apache.myfaces.extensions.validator.internal.UsageInformation;
 import org.apache.myfaces.extensions.validator.internal.UsageCategory;
@@ -43,10 +44,9 @@ public class RequiredIfStrategy extends 
 {
     private boolean useFacesBundle = false;
 
-    @Override
-    public boolean useTargetComponentToDisplayErrorMsg(CrossValidationStorageEntry crossValidationStorageEntry)
+    protected MessageTarget getMessageTarget(RequiredIf annotation)
     {
-        return false;
+        return annotation.validationErrorMsgTarget();
     }
 
     @Override



Mime
View raw message