You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lo...@apache.org on 2012/09/07 18:13:49 UTC

svn commit: r1382082 - /myfaces/tobago/trunk/tobago-extension/tobago-facelets/src/main/java/org/apache/myfaces/tobago/facelets/AttributeHandler.java

Author: lofwyr
Date: Fri Sep  7 16:13:49 2012
New Revision: 1382082

URL: http://svn.apache.org/viewvc?rev=1382082&view=rev
Log:
TOBAGO-1194: The component tc:attribute with mode="valueIsSet" doesn't work for facelet tags, some cases.

Modified:
    myfaces/tobago/trunk/tobago-extension/tobago-facelets/src/main/java/org/apache/myfaces/tobago/facelets/AttributeHandler.java

Modified: myfaces/tobago/trunk/tobago-extension/tobago-facelets/src/main/java/org/apache/myfaces/tobago/facelets/AttributeHandler.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-extension/tobago-facelets/src/main/java/org/apache/myfaces/tobago/facelets/AttributeHandler.java?rev=1382082&r1=1382081&r2=1382082&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-extension/tobago-facelets/src/main/java/org/apache/myfaces/tobago/facelets/AttributeHandler.java (original)
+++ myfaces/tobago/trunk/tobago-extension/tobago-facelets/src/main/java/org/apache/myfaces/tobago/facelets/AttributeHandler.java Fri Sep  7 16:13:49 2012
@@ -184,18 +184,17 @@ public final class AttributeHandler exte
           }
         } else if ("valueIfSet".equals(mode.getValue())) {
           String expressionString = value.getValue();
+          String lastExpressionString = null;
           while (isMethodOrValueExpression(expressionString) && isSimpleExpression(expressionString)) {
             ValueExpression expression
                 = faceletContext.getVariableMapper().resolveVariable(removeElParenthesis(expressionString));
-            if (expression == null) {
-              if (LOG.isDebugEnabled()) {
-                // when the action hasn't been set while using a composition.
-                LOG.debug("Variable can't be resolved: value='" + expressionString + "'");
-              }
-              expressionString = null;
-              break;
-            } else {
+            if (expression != null) {
+              lastExpressionString = expressionString;
               expressionString = expression.getExpressionString();
+            } else {
+              // restore last value
+              expressionString = lastExpressionString;
+              break;
             }
           }
           if (expressionString != null) {
@@ -207,7 +206,7 @@ public final class AttributeHandler exte
             }
           }
         } else {
-          throw new FacesException("Type " + mode + " not suppored");
+          throw new FacesException("Type " + mode + " not supported");
         }
       } else {