Author: akushunin
Date: 2007-12-20 09:02:35 -0500 (Thu, 20 Dec 2007)
New Revision: 4937
Modified:
branches/3.1.x/ui/calendar/src/main/java/org/richfaces/renderkit/CalendarRendererBase.java
branches/3.1.x/ui/dataTable/src/main/java/org/richfaces/renderkit/CellRenderer.java
Log:
RF-1708
Modified:
branches/3.1.x/ui/calendar/src/main/java/org/richfaces/renderkit/CalendarRendererBase.java
===================================================================
---
branches/3.1.x/ui/calendar/src/main/java/org/richfaces/renderkit/CalendarRendererBase.java 2007-12-20
11:47:25 UTC (rev 4936)
+++
branches/3.1.x/ui/calendar/src/main/java/org/richfaces/renderkit/CalendarRendererBase.java 2007-12-20
14:02:35 UTC (rev 4937)
@@ -225,15 +225,16 @@
ResponseWriter writer = context.getResponseWriter();
String clientId = component.getClientId(context);
String divStyle = "";
+ //Fix for jdk 1.4. Contains method in java.lang.String exists since jdk 1.5
if (cellwidth != null && cellwidth.length() != 0) {
- if (cellwidth.contains("px") || cellwidth.contains("%")) {
+ if ((cellwidth.indexOf("px") > -1) ||
(cellwidth.indexOf("%")>-1)) {
divStyle = divStyle + "width:" + cellwidth + ";";
} else {
divStyle = divStyle + "width:" + cellwidth + "px;";
}
}
if (cellheight != null && cellheight.length() != 0) {
- if (cellheight.contains("px") || cellheight.contains("%")) {
+ if ((cellheight.indexOf("px") > -1) ||
(cellheight.indexOf("%")>-1)) {
divStyle = divStyle + "height:" + cellheight.toString() + ";";
} else {
divStyle = divStyle + "height:" + cellheight.toString() + "px;";
Modified:
branches/3.1.x/ui/dataTable/src/main/java/org/richfaces/renderkit/CellRenderer.java
===================================================================
---
branches/3.1.x/ui/dataTable/src/main/java/org/richfaces/renderkit/CellRenderer.java 2007-12-20
11:47:25 UTC (rev 4936)
+++
branches/3.1.x/ui/dataTable/src/main/java/org/richfaces/renderkit/CellRenderer.java 2007-12-20
14:02:35 UTC (rev 4937)
@@ -65,7 +65,8 @@
super.doEncodeBegin(writer, context, component);
java.lang.String clientId = component.getClientId(context);
- boolean isHeader = (styleClass(context, component)).contains("header");
+ //Fix for jdk 1.4. Contains method in java.lang.String exists since jdk 1.5
+ boolean isHeader = (styleClass(context, component)).indexOf("header") >
-1;
if(isHeader)
{
writer.startElement("th", component);
@@ -115,7 +116,8 @@
protected void doEncodeEnd(ResponseWriter writer, FacesContext context, UIComponent
component) throws IOException {
// TODO Auto-generated method stub
super.doEncodeEnd(writer, context, component);
- boolean isHeader = (styleClass(context, component)).contains("header");
+ //Fix for jdk 1.4. Contains method in java.lang.String exists since jdk 1.5
+ boolean isHeader = (styleClass(context, component)).indexOf("header") >
-1;
if(isHeader)
{
writer.endElement("th");