myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mkien...@apache.org
Subject svn commit: r523784 - /myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/component/html/ext/HtmlDataTable.java
Date Thu, 29 Mar 2007 18:08:39 GMT
Author: mkienenb
Date: Thu Mar 29 11:08:38 2007
New Revision: 523784

URL: http://svn.apache.org/viewvc?view=rev&rev=523784
Log:
Fix for TOMAHAWK-914 - t:dataTable style attributes don't work with Facelets
Thanks to Jeff Bischoff.

Modified:
    myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/component/html/ext/HtmlDataTable.java

Modified: myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/component/html/ext/HtmlDataTable.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/component/html/ext/HtmlDataTable.java?view=diff&rev=523784&r1=523783&r2=523784
==============================================================================
--- myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/component/html/ext/HtmlDataTable.java
(original)
+++ myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/component/html/ext/HtmlDataTable.java
Thu Mar 29 11:08:38 2007
@@ -1209,10 +1209,21 @@
 
     public String getRowStyleClass()
     {
-        if (_rowStyleClass != null)
-            return _rowStyleClass;
-        ValueBinding vb = getValueBinding(JSFAttr.ROW_STYLECLASS_ATTR);
-        return vb != null ? (String) vb.getValue(getFacesContext()) : null;
+	if (_rowStyleClass != null)
+	    return _rowStyleClass;
+
+	// TODO: temporarily support fully-qualified ext. dataTable attribute names.
+	ValueBinding vb = getValueBinding("org.apache.myfaces.dataTable.ROW_STYLECLASS");
+	if (vb != null)
+	    log.warn("org.apache.myfaces.dataTable.ROW_STYLECLASS is deprecated. Please use rowStyleClass
instead.");
+	else
+	    vb = getValueBinding(JSFAttr.ROW_STYLECLASS_ATTR);
+	if(vb == null)
+	    return null;
+	String bindingValue = (String) vb.getValue(getFacesContext());
+	if(bindingValue == "")
+	    return null;  // Fix for JSF 1.2 EL coercing nulls to empty string
+	return bindingValue;
     }
 
     public void setRowStyleClass(String rowStyleClass)
@@ -1224,8 +1235,19 @@
     {
         if (_rowStyle != null)
             return _rowStyle;
-        ValueBinding vb = getValueBinding(JSFAttr.ROW_STYLE_ATTR);
-        return vb != null ? (String) vb.getValue(getFacesContext()) : null;
+	
+	// TODO: temporarily support fully-qualified ext. dataTable attribute names.
+        ValueBinding vb = getValueBinding("org.apache.myfaces.dataTable.ROW_STYLE");
+	if (vb != null)
+	    log.warn("org.apache.myfaces.dataTable.ROW_STYLE is deprecated. Please use rowStyle
instead.");
+	else
+	    vb = getValueBinding(JSFAttr.ROW_STYLE_ATTR);
+	if(vb == null)
+	    return null;
+	String bindingValue = (String) vb.getValue(getFacesContext());
+	if(bindingValue == "")
+	    return null;  // Fix for JSF 1.2 EL coercing nulls to empty string
+	return bindingValue;
     }
 
     public void setRowStyle(String rowStyle)



Mime
View raw message