Author: abelevich
Date: 2007-09-18 08:59:19 -0400 (Tue, 18 Sep 2007)
New Revision: 2978
Modified:
trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/AbstractTableRenderer.java
Log:
temporary solution RF-957 (percentage values are not allowed)
Modified:
trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/AbstractTableRenderer.java
===================================================================
---
trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/AbstractTableRenderer.java 2007-09-18
11:37:21 UTC (rev 2977)
+++
trunk/ui/dataTable/src/main/java/org/richfaces/renderkit/AbstractTableRenderer.java 2007-09-18
12:59:19 UTC (rev 2978)
@@ -24,6 +24,7 @@
import java.io.IOException;
import java.util.Iterator;
+import javax.faces.FacesException;
import javax.faces.component.UIColumn;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
@@ -50,6 +51,9 @@
* @param table
* @throws IOException
*/
+
+ protected final static String PERSENTAGE_SUPPORT_ERROR_MSG = "columnsWidth
property: Percentage values are not supported";
+
public void encodeTableStructure(FacesContext context, UIDataTable table)
throws IOException {
ResponseWriter writer = context.getResponseWriter();
@@ -57,8 +61,13 @@
// Encode colgroup definition.
writer.startElement("colgroup", table);
writer.writeAttribute("span", String.valueOf(columns), null);
- String columnsWidth = (String) table.getAttributes()
- .get("columnsWidth");
+ String columnsWidth = (String) table.getAttributes().get("columnsWidth");
+
+ // temporary solution RF-957
+ if(columnsWidth.contains("%")){
+ throw new FacesException(PERSENTAGE_SUPPORT_ERROR_MSG);
+ }
+
if (null != columnsWidth) {
String[] widths = columnsWidth.split(",");
for (int i = 0; i < widths.length; i++) {
Show replies by date