Author: akushunin
Date: 2007-10-31 10:08:03 -0400 (Wed, 31 Oct 2007)
New Revision: 3634
Modified:
trunk/ui/calendar/src/main/java/org/richfaces/renderkit/CalendarRendererBase.java
trunk/ui/calendar/src/main/templates/org/richfaces/htmlCalendar.jspx
Log:
Calendar refactoring
Modified:
trunk/ui/calendar/src/main/java/org/richfaces/renderkit/CalendarRendererBase.java
===================================================================
---
trunk/ui/calendar/src/main/java/org/richfaces/renderkit/CalendarRendererBase.java 2007-10-31
13:29:40 UTC (rev 3633)
+++
trunk/ui/calendar/src/main/java/org/richfaces/renderkit/CalendarRendererBase.java 2007-10-31
14:08:03 UTC (rev 3634)
@@ -204,7 +204,7 @@
}
}
- public void writeDayCellClass(FacesContext context, UIComponent component)
+ public void dayCellClass(FacesContext context, UIComponent component)
throws IOException {
// if cellWidth/Height is set send dayCellClass to script
Integer cellwidth = (Integer) component.getAttributes()
@@ -212,19 +212,23 @@
Integer cellheight = (Integer) component.getAttributes().get(
"cellHeight");
ResponseWriter writer = context.getResponseWriter();
+ String clientId = component.getClientId(context);
+ String divStyle="." + clientId + "DayCell{";
+ if (cellwidth != null && cellwidth.intValue() > 0){
+ divStyle = divStyle + "width:"+ cellwidth.toString() + "px;";
+ }
+ if(cellheight != null
+ && cellheight.intValue() > 0){
+ divStyle = divStyle +"height:"+ cellheight.toString() + "px;";
+ }
+
if (cellwidth != null && cellwidth.intValue() > 0 || cellheight != null
&& cellheight.intValue() > 0) {
-
- String clientId = component.getClientId(context);
-
- String divStyle = "." + clientId + "DayCell{width: "
- + cellwidth.toString() + "px; height:"
- + cellheight.toString() + "px; }<style/>";
- writer.writeText(divStyle, null);
+ writer.writeText(divStyle+"}", null);
}
}
- public void dayCellClass(FacesContext context, UIComponent component)
+ public void writeDayCellClass(FacesContext context, UIComponent component)
throws IOException {
Integer cellwidth = (Integer) component.getAttributes()
@@ -236,7 +240,7 @@
&& cellheight.intValue() > 0) {
String clientId = component.getClientId(context);
- writer.writeText("dayCellClass: " + clientId + "DayCell,", null);
+ writer.writeText("dayCellClass: '" + clientId +
"DayCell',", null);
}
if (component.getChildCount() != 0) {
Modified: trunk/ui/calendar/src/main/templates/org/richfaces/htmlCalendar.jspx
===================================================================
--- trunk/ui/calendar/src/main/templates/org/richfaces/htmlCalendar.jspx 2007-10-31
13:29:40 UTC (rev 3633)
+++ trunk/ui/calendar/src/main/templates/org/richfaces/htmlCalendar.jspx 2007-10-31
14:08:03 UTC (rev 3634)
@@ -116,7 +116,7 @@
]]>
</jsp:scriptlet> </span>
<style type="text/css">
- <f:call name="writeDayCellClass" />
+ <f:call name="dayCellClass" />
</style>
<script type="text/javascript">
new Calendar('#{clientId}', {
@@ -147,12 +147,13 @@
showInput: #{component.attributes['showInput']},
disabled: #{component.disabled},
ajaxSingle: #{component.attributes['ajaxSingle']},
- verticalOffset:'#{component.verticalOffset}',
- horizontalOffset: '#{component.horizontalOffset}',
+ verticalOffset:#{component.verticalOffset},
+ horizontalOffset: #{component.horizontalOffset},
style:'z-index: #{component.attributes["zindex"]};
#{component.attributes["style"]}',
<f:call name="writeClass"/>
- <f:call name="dayCellClass"/>
+ <f:call name="writeDayCellClass"/>
+ <f:call name="writeDayStyleClass"/>
<f:call name="writeIsDayEnabled"/>
<f:call name="writeSymbols" />,
firstWeekDay: #{this:getFirstWeekDay(context, component)},
Show replies by date