Author: abelevich
Date: 2011-01-20 08:01:04 -0500 (Thu, 20 Jan 2011)
New Revision: 21114
Modified:
trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/CalendarRendererBase.java
trunk/ui/input/ui/src/main/templates/calendar.template.xml
Log:
RF-10094 Inline default values: input components I
- added default value to template
Modified:
trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/CalendarRendererBase.java
===================================================================
---
trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/CalendarRendererBase.java 2011-01-20
12:36:29 UTC (rev 21113)
+++
trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/CalendarRendererBase.java 2011-01-20
13:01:04 UTC (rev 21114)
@@ -613,4 +613,12 @@
}
return value;
}
+
+ protected AbstractCalendar.Mode getModeOrDefault(UIComponent component) {
+ AbstractCalendar.Mode value = ((AbstractCalendar) component).getMode();
+ if (value == null) {
+ value = AbstractCalendar.Mode.client;
+ }
+ return value;
+ }
}
\ No newline at end of file
Modified: trunk/ui/input/ui/src/main/templates/calendar.template.xml
===================================================================
--- trunk/ui/input/ui/src/main/templates/calendar.template.xml 2011-01-20 12:36:29 UTC
(rev 21113)
+++ trunk/ui/input/ui/src/main/templates/calendar.template.xml 2011-01-20 13:01:04 UTC
(rev 21114)
@@ -69,12 +69,15 @@
<script type="text/javascript">
<cdk:scriptObject name="options">
- <cdk:scriptOption attributes="enableManualInput disabled readonly
resetTimeOnDateSelect showApplyButton popup showInput showHeader showFooter showWeeksBar
datePattern horizontalOffset verticalOffset hidePopupOnScrol showWeekDaysBar styleClass
mode defaultLabel" />
+ <cdk:scriptOption attributes="enableManualInput disabled readonly
resetTimeOnDateSelect showApplyButton popup showInput showHeader showFooter showWeeksBar
datePattern hidePopupOnScrol showWeekDaysBar styleClass defaultLabel" />
<cdk:scriptOption attributes="onchange ondateselect onbeforedateselect
onbeforecurrentdateselect onhide onshow ondatemouseover ondatemouseout onclean
ontimeselect onbeforetimeselect" wrapper="eventHandler" />
- <cdk:scriptOption name="todayControlMode"
value="#{getTodayControlModeOrDefault(component)}" />
+ <cdk:scriptOption name="mode"
value="#{getModeOrDefault(component)}"
defaultValue="org.richfaces.component.AbstractCalendar.Mode.client"/>
+ <cdk:scriptOption name="todayControlMode"
value="#{getTodayControlModeOrDefault(component)}"
defaultValue='"select"'/>
<cdk:scriptOption name="jointPoint"
value="#{getJointPointOrDefault(component)}" />
<cdk:scriptOption name="direction"
value="#{getDirectionOrDefault(component)}" />
- <cdk:scriptOption name="boundaryDatesMode"
value="#{getBoundaryDatesModeOrDefault(component)}" />
+ <cdk:scriptOption name="horizontalOffset"
value="#{component.attributes['horizontalOffset']}"
defaultValue="0"/>
+ <cdk:scriptOption name="verticalOffset"
value="#{component.attributes['verticalOffset']}"
defaultValue="0"/>
+ <cdk:scriptOption name="boundaryDatesMode"
value="#{getBoundaryDatesModeOrDefault(component)}"
defaultValue='"inactive"'/>
<cdk:scriptOption name="currentDate"
value="#{getCurrentDate(facesContext, component)}" />
<cdk:scriptOption name="selectedDate"
value="#{getSelectedDate(facesContext, component)}" />
<cdk:scriptOption name="dayCellClass"
value="#{getDayCellClass(facesContext, component)}" />