myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gcrawf...@apache.org
Subject svn commit: r1068539 - /myfaces/trinidad/trunk/trinidad-api/src/main/java/org/apache/myfaces/trinidad/util/LabeledFacesMessage.java
Date Tue, 08 Feb 2011 19:34:07 GMT
Author: gcrawford
Date: Tue Feb  8 19:34:06 2011
New Revision: 1068539

URL: http://svn.apache.org/viewvc?rev=1068539&view=rev
Log:
TRINIDAD-2029 LabeledFacesMessage should handle the case where label is of type ValueExpression


Modified:
    myfaces/trinidad/trunk/trinidad-api/src/main/java/org/apache/myfaces/trinidad/util/LabeledFacesMessage.java

Modified: myfaces/trinidad/trunk/trinidad-api/src/main/java/org/apache/myfaces/trinidad/util/LabeledFacesMessage.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/trunk/trinidad-api/src/main/java/org/apache/myfaces/trinidad/util/LabeledFacesMessage.java?rev=1068539&r1=1068538&r2=1068539&view=diff
==============================================================================
--- myfaces/trinidad/trunk/trinidad-api/src/main/java/org/apache/myfaces/trinidad/util/LabeledFacesMessage.java
(original)
+++ myfaces/trinidad/trunk/trinidad-api/src/main/java/org/apache/myfaces/trinidad/util/LabeledFacesMessage.java
Tue Feb  8 19:34:06 2011
@@ -18,6 +18,8 @@
  */
 package org.apache.myfaces.trinidad.util;
 
+import javax.el.ValueExpression;
+
 import javax.faces.application.FacesMessage;
 import javax.faces.context.FacesContext;
 import javax.faces.el.ValueBinding;
@@ -89,7 +91,12 @@ public class LabeledFacesMessage extends
   public String getLabelAsString(FacesContext context)
   {
     Object label = getLabel();
-    if (label instanceof ValueBinding)
+
+    if (label instanceof ValueExpression)
+    {
+      label = ((ValueExpression) label).getValue(context.getELContext());          
+    }
+    else if (label instanceof ValueBinding)
     {
       label = ((ValueBinding) label).getValue(context);
     }



Mime
View raw message