You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by ja...@apache.org on 2010/05/21 17:35:03 UTC
svn commit: r947043 -
/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/ValidatorTagHandlerDelegate.java
Author: jakobk
Date: Fri May 21 15:35:02 2010
New Revision: 947043
URL: http://svn.apache.org/viewvc?rev=947043&view=rev
Log:
MYFACES-2731 <f:validateBean disabled="true" /> should only disable adding the validator as a default-validator
Modified:
myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/ValidatorTagHandlerDelegate.java
Modified: myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/ValidatorTagHandlerDelegate.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/ValidatorTagHandlerDelegate.java?rev=947043&r1=947042&r2=947043&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/ValidatorTagHandlerDelegate.java (original)
+++ myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/tag/jsf/ValidatorTagHandlerDelegate.java Fri May 21 15:35:02 2010
@@ -37,7 +37,6 @@ import javax.faces.view.facelets.TagExce
import javax.faces.view.facelets.TagHandlerDelegate;
import javax.faces.view.facelets.ValidatorHandler;
-import org.apache.myfaces.view.facelets.AbstractFaceletContext;
import org.apache.myfaces.view.facelets.FaceletCompositionContext;
import org.apache.myfaces.view.facelets.compiler.FaceletsCompilerUtils;
import org.apache.myfaces.view.facelets.tag.MetaRulesetImpl;
@@ -205,27 +204,6 @@ public class ValidatorTagHandlerDelegate
String validatorId = _delegate.getValidatorConfig().getValidatorId();
- // check if the parent's exclusion list already contains the validatorId
- List<String> exclusionList
- = (List<String>) parent.getAttributes().get(VALIDATOR_ID_EXCLUSION_LIST_KEY);
- if (exclusionList != null && exclusionList.contains(validatorId))
- {
- // FIXME Mojarra does not do this at the moment, but the spec says:
- // "[...] (the validatorId) should be added to an exclusion
- // list on the parent component to prevent a default validator with the same
- // id from beeing registered on the component."
- //
- // You can test this with the following scenario:
- // <h:inputText>
- // <f:validateBean disabled="true"/>
- // <f:validateBean />
- // </h:inputText>
- // --> the second <f:validateBean /> shouldn't be registered! -=Jakob Korherr=-
-
- // do not add the validator
- return;
- }
-
// spec: if the disabled attribute is true, the validator should not be added.
// in addition, the validatorId, if present, should be added to an exclusion
// list on the parent component to prevent a default validator with the same
@@ -235,6 +213,8 @@ public class ValidatorTagHandlerDelegate
// tag is disabled --> add its validatorId to the parent's exclusion list
if (validatorId != null && !"".equals(validatorId))
{
+ List<String> exclusionList = (List<String>) parent.getAttributes()
+ .get(VALIDATOR_ID_EXCLUSION_LIST_KEY);
if (exclusionList == null)
{
exclusionList = new ArrayList<String>();