Author: artdaw
Date: 2011-01-20 13:43:56 -0500 (Thu, 20 Jan 2011)
New Revision: 21131
Modified:
trunk/examples/input-demo/src/main/java/org/richfaces/demo/CalendarBean.java
trunk/examples/input-demo/src/main/webapp/examples/calendar.xhtml
trunk/ui/core/ui/src/main/java/org/richfaces/component/AbstractParameter.java
trunk/ui/input/ui/src/main/java/org/richfaces/component/AbstractCalendar.java
trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/CalendarRendererBase.java
trunk/ui/input/ui/src/main/templates/calendar.template.xml
trunk/ui/iteration/ui/src/test/java/org/richfaces/renderkit/DataScrollerRenderTest.java
Log:
RF-10213: Calendar direction and jointPoint attributes are fixed. Checkstyle test is fixed
for AbstractParameter.
Modified: trunk/examples/input-demo/src/main/java/org/richfaces/demo/CalendarBean.java
===================================================================
---
trunk/examples/input-demo/src/main/java/org/richfaces/demo/CalendarBean.java 2011-01-20
18:13:25 UTC (rev 21130)
+++
trunk/examples/input-demo/src/main/java/org/richfaces/demo/CalendarBean.java 2011-01-20
18:43:56 UTC (rev 21131)
@@ -7,6 +7,7 @@
import javax.faces.bean.SessionScoped;
import javax.faces.event.ValueChangeEvent;
+import org.richfaces.component.Positioning;
import org.richfaces.event.CurrentDateChangeEvent;
@ManagedBean
@@ -20,11 +21,12 @@
private boolean showApply = true;
private boolean useCustomDayLabels;
private String mode = "client";
- private String jointPoint = "auto-auto";
- private String direction = "auto-auto";
+ private Positioning jointPoint = Positioning.DEFAULT;
+ private Positioning direction = Positioning.DEFAULT;
private int horizontalOffset = 0;
private int verticalOffset = 0;
-
+ private Positioning[] positioningValues = Positioning.values();
+
public CalendarBean() {
locale = Locale.US;
@@ -98,19 +100,19 @@
this.showApply = showApply;
}
- public void setJointPoint(String jointPoint) {
+ public void setJointPoint(Positioning jointPoint) {
this.jointPoint = jointPoint;
}
- public String getJointPoint() {
+ public Positioning getJointPoint() {
return jointPoint;
}
- public void setDirection(String direction) {
+ public void setDirection(Positioning direction) {
this.direction = direction;
}
- public String getDirection() {
+ public Positioning getDirection() {
return direction;
}
@@ -137,4 +139,8 @@
public void doCurrentDataChangeListener(CurrentDateChangeEvent event) {
System.out.println("doCurrentDataChangeListener:
"+event.getCurrentDateString());
}
+
+ public Positioning[] getPositioningValues() {
+ return positioningValues;
+ }
}
\ No newline at end of file
Modified: trunk/examples/input-demo/src/main/webapp/examples/calendar.xhtml
===================================================================
--- trunk/examples/input-demo/src/main/webapp/examples/calendar.xhtml 2011-01-20 18:13:25
UTC (rev 21130)
+++ trunk/examples/input-demo/src/main/webapp/examples/calendar.xhtml 2011-01-20 18:43:56
UTC (rev 21131)
@@ -1,11 +1,11 @@
<?xml version='1.0' encoding='UTF-8'?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html
xmlns="http://www.w3.org/1999/xhtml"
-
xmlns:h="http://java.sun.com/jsf/html"
-
xmlns:f="http://java.sun.com/jsf/core"
-
xmlns:ui="http://java.sun.com/jsf/facelets"
-
xmlns:a4j="http://richfaces.org/a4j"
-
xmlns:calendar="http://richfaces.org/input">
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:a4j="http://richfaces.org/a4j"
+
xmlns:calendar="http://richfaces.org/input">
<!--
JBoss, Home of Professional Open Source
Copyright ${year}, Red Hat, Inc. and individual contributors
@@ -31,130 +31,125 @@
02110-1301 USA, or see the FSF site:
http://www.fsf.org.
-->
<h:head>
- <title>Richfaces Calendar Demo</title>
- <script>
- var myFunction = function(event){
- ;
- }
- </script>
+ <title>Richfaces Calendar Demo</title>
+ <script type="text/javascript">
+ var myFunction = function(event) {
+
+ }
+ </script>
</h:head>
<h:body>
- <h:form id="form">
- <h:panelGrid id="panel" columns="3">
- <h:panelGroup layout="block">
- <calendar:calendar value="#{calendarBean.selectedDate}"
id="calendar"
- jointPoint="#{calendarBean.jointPoint}"
direction="#{calendarBean.direction}"
- locale="#{calendarBean.locale}" popup="#{calendarBean.popup}"
- datePattern="#{calendarBean.pattern}"
- dataModel="#{calendarDataModel}"
- mode="#{calendarBean.mode}"
- disabled="false"
- cellWidth="24px"
- cellHeight="22px" minDaysInFirstWeek="3"
- oncollapse="return onEvent.call(this, event);"
- onexpand="return onEvent.call(this, event);"
- oncurrentdateselect="return onEvent.call(this, event);"
- oncurrentdateselected="return onEvent.call(this, event);"
- ondateselect="return onEvent.call(this, event);"
- ondateselected="return onEvent.call(this, event);"
- ontimeselect="return onEvent.call(this, event);"
- ontimeselected="return onEvent.call(this, event);"
- oncomplete="return onEvent.call(this, event);"
- onclean="return onEvent.call(this, event);"
- ondatemouseout="return onEvent.call(this, event);"
- ondatemouseover="return onEvent.call(this, event);"
- firstWeekDay="4"
- horizontalOffset="#{calendarBean.horizontalOffset}"
- verticalOffset="#{calendarBean.verticalOffset}"
defaultTime="11:22:01"
- valueChangeListener="#{calendarBean.doValueChangeListener}"
- currentDataChangeListener="#{calendarBean.doCurrentDataChangeListener}"
- onbeforedateselect="myFunction(event)"
- style="width:200px;border:10px solid #000000"
- styleClass="hello"
- boundaryDatesMode = "scroll"
- defaultLabel = "bla-bla-bla"
- enableManualInput="false"
- >
-
- </calendar:calendar>
- <h:outputText id="echo-text"
value="#{calendarBean.selectedDate}" />
- </h:panelGroup>
- <h:panelGrid columns="2">
- <h:outputText value="Popup Mode:" />
- <h:selectBooleanCheckbox value="#{calendarBean.popup}">
- <f:ajax event="click" execute="@form" render="calendar
@this" />
- </h:selectBooleanCheckbox>
- <h:outputText value="Apply Button:" />
- <h:selectBooleanCheckbox value="#{calendarBean.showApply}">
- <f:ajax event="click" execute="@form" render="calendar
@this" />
- </h:selectBooleanCheckbox>
- <h:outputText value="Select Locale" />
- <h:selectOneRadio value="en/US"
- valueChangeListener="#{calendarBean.selectLocale}">
- <f:ajax execute="@form" event="click" render="calendar
@this" />
- <f:selectItem itemLabel="US" itemValue="en/US" />
- <f:selectItem itemLabel="DE" itemValue="de/DE" />
- <f:selectItem itemLabel="FR" itemValue="fr/FR" />
- <f:selectItem itemLabel="RU" itemValue="ru/RU" />
- </h:selectOneRadio>
+ <h:form id="form">
+ <a4j:outputPanel ajaxRendered="true">
+ <h:messages />
+ </a4j:outputPanel>
+ <h:panelGrid id="panel" columns="3">
+ <h:panelGroup layout="block">
+ <calendar:calendar value="#{calendarBean.selectedDate}"
id="calendar"
+ jointPoint="#{calendarBean.jointPoint}"
direction="#{calendarBean.direction}"
+ locale="#{calendarBean.locale}"
popup="#{calendarBean.popup}"
+ datePattern="#{calendarBean.pattern}"
+ dataModel="#{calendarDataModel}"
+ mode="#{calendarBean.mode}"
+ disabled="false"
+ cellWidth="24px"
+ cellHeight="22px"
minDaysInFirstWeek="3"
+ oncollapse="return onEvent.call(this,
event);"
+ onexpand="return onEvent.call(this,
event);"
+ oncurrentdateselect="return onEvent.call(this,
event);"
+ oncurrentdateselected="return onEvent.call(this,
event);"
+ ondateselect="return onEvent.call(this,
event);"
+ ondateselected="return onEvent.call(this,
event);"
+ ontimeselect="return onEvent.call(this,
event);"
+ ontimeselected="return onEvent.call(this,
event);"
+ oncomplete="return onEvent.call(this,
event);"
+ onclean="return onEvent.call(this, event);"
+ ondatemouseout="return onEvent.call(this,
event);"
+ ondatemouseover="return onEvent.call(this,
event);"
+ firstWeekDay="4"
+
horizontalOffset="#{calendarBean.horizontalOffset}"
+
verticalOffset="#{calendarBean.verticalOffset}"
defaultTime="11:22:01"
+
valueChangeListener="#{calendarBean.doValueChangeListener}"
+
currentDataChangeListener="#{calendarBean.doCurrentDataChangeListener}"
+ onbeforedateselect="myFunction(event)"
+ style="width:200px;border:10px solid
#000000"
+ styleClass="hello"
+ boundaryDatesMode="scroll"
+ defaultLabel=""
+ enableManualInput="false"
+ >
- <h:outputText value="Select Date Pattern:" />
- <h:selectOneMenu value="#{calendarBean.pattern}">
- <f:ajax execute="@form" event="change" render="calendar
@this" />
- <f:selectItem itemLabel="d/M/yy HH:mm" itemValue="d/M/yy
HH:mm" />
- <f:selectItem itemLabel="dd/M/yy hh:mm a"
- itemValue="dd/M/yy hh:mm a" />
- <f:selectItem itemLabel="dd/M/yy hh:mm:ss"
- itemValue="dd/M/yy hh:mm:ss" />
- <f:selectItem itemLabel="d/MMM/y" itemValue="d/MMM/y" />
- <f:selectItem itemLabel="MMM d, yyyy" itemValue="MMM d, yyyy"
/>
- </h:selectOneMenu>
-
- <h:outputText value="Mode" />
- <h:selectOneMenu value="#{calendarBean.mode}"
onchange="submit()">
- <f:selectItem itemValue="client"/>
- <f:selectItem itemValue="ajax"/>
- </h:selectOneMenu>
-
- <h:outputText value="Select joint point:" />
- <h:selectOneMenu value="#{calendarBean.jointPoint}">
- <f:ajax execute="@form" event="change" render="calendar
@this" />
- <f:selectItem itemLabel="auto-auto" itemValue="auto-auto"
/>
- <f:selectItem itemLabel="top-left" itemValue="top-left"
/>
- <f:selectItem itemLabel="top-right" itemValue="top-right"
/>
- <f:selectItem itemLabel="bottom-left" itemValue="bottom-left"
/>
- <f:selectItem itemLabel="bottom-right"
itemValue="bottom-right" />
- </h:selectOneMenu>
- <h:outputText value="Select direction:" />
- <h:selectOneMenu value="#{calendarBean.direction}">
- <f:ajax execute="@form" event="change" render="calendar
@this" />
- <f:selectItem itemLabel="auto-auto" itemValue="auto-auto"
/>
- <f:selectItem itemLabel="top-left" itemValue="top-left"
/>
- <f:selectItem itemLabel="top-right" itemValue="top-right"
/>
- <f:selectItem itemLabel="bottom-left" itemValue="bottom-left"
/>
- <f:selectItem itemLabel="bottom-right"
itemValue="bottom-right" />
- </h:selectOneMenu>
- <h:outputText value="Horisontal offset:" />
- <h:inputText value="#{calendarBean.horizontalOffset}">
- <f:ajax execute="@form" event="change" render="calendar
@this" />
- </h:inputText>
- <h:outputText value="Vertical offset:" />
- <h:inputText value="#{calendarBean.verticalOffset}">
- <f:ajax execute="@form" event="change" render="calendar
@this" />
- </h:inputText>
- </h:panelGrid>
- <h:panelGroup layout="block">
- <div>
- <a4j:log mode="inline"></a4j:log>
- </div>
- <script type="text/javascript">
- onEvent = function(event, element, data){
- RichFaces.log.info("jQuery Event: "+(event instanceof
jQuery.Event)+"; event: "+event.type+"; data:"+(data ||
(event['rich']||{})['data'])+"; this.id:"+this.id+";
component:"+
(event['rich']||{})['component']||RichFaces.$(this.id));
- };
- //RichFaces.Event.bindById("form:calendar", "dateselect dateselected
currentdateselect currentdateselected timeselect timeselected changed clean collapse
expand complete datemouseout datemouseout", onEvent);
- </script>
- </h:panelGroup>
- </h:panelGrid>
- </h:form>
+ </calendar:calendar>
+ <h:outputText id="echo-text"
value="#{calendarBean.selectedDate}"/>
+ </h:panelGroup>
+ <h:panelGrid columns="2">
+ <h:outputText value="Popup Mode:"/>
+ <h:selectBooleanCheckbox value="#{calendarBean.popup}">
+ <f:ajax event="click" execute="@form"
render="calendar @this"/>
+ </h:selectBooleanCheckbox>
+ <h:outputText value="Apply Button:"/>
+ <h:selectBooleanCheckbox
value="#{calendarBean.showApply}">
+ <f:ajax event="click" execute="@form"
render="calendar @this"/>
+ </h:selectBooleanCheckbox>
+ <h:outputText value="Select Locale"/>
+ <h:selectOneRadio value="en/US"
+
valueChangeListener="#{calendarBean.selectLocale}">
+ <f:ajax execute="@form" event="click"
render="calendar @this"/>
+ <f:selectItem itemLabel="US"
itemValue="en/US"/>
+ <f:selectItem itemLabel="DE"
itemValue="de/DE"/>
+ <f:selectItem itemLabel="FR"
itemValue="fr/FR"/>
+ <f:selectItem itemLabel="RU"
itemValue="ru/RU"/>
+ </h:selectOneRadio>
+
+ <h:outputText value="Select Date Pattern:"/>
+ <h:selectOneMenu value="#{calendarBean.pattern}">
+ <f:ajax execute="@form" event="change"
render="calendar @this"/>
+ <f:selectItem itemLabel="d/M/yy HH:mm"
itemValue="d/M/yy HH:mm"/>
+ <f:selectItem itemLabel="dd/M/yy hh:mm a"
+ itemValue="dd/M/yy hh:mm a"/>
+ <f:selectItem itemLabel="dd/M/yy hh:mm:ss"
+ itemValue="dd/M/yy hh:mm:ss"/>
+ <f:selectItem itemLabel="d/MMM/y"
itemValue="d/MMM/y"/>
+ <f:selectItem itemLabel="MMM d, yyyy"
itemValue="MMM d, yyyy"/>
+ </h:selectOneMenu>
+
+ <h:outputText value="Mode"/>
+ <h:selectOneMenu value="#{calendarBean.mode}"
onchange="submit()">
+ <f:selectItem itemValue="client"/>
+ <f:selectItem itemValue="ajax"/>
+ </h:selectOneMenu>
+
+ <h:outputText value="Select joint point:"/>
+ <h:selectOneMenu value="#{calendarBean.jointPoint}">
+ <a4j:ajax execute="@form" event="change"
render="calendar, @this"/>
+ <f:selectItems value="#{calendarBean.positioningValues}"
var="v" itemLabel="#{v}" itemValue="#{v}"/>
+ </h:selectOneMenu>
+ <h:outputText value="Select direction:"/>
+ <h:selectOneMenu value="#{calendarBean.direction}">
+ <f:ajax execute="@form" event="change"
reRender="calendar, @this"/>
+ <f:selectItems value="#{calendarBean.positioningValues}"
var="v" itemLabel="#{v}" itemValue="#{v}"/>
+ </h:selectOneMenu>
+ <h:outputText value="Horisontal offset:"/>
+ <h:inputText value="#{calendarBean.horizontalOffset}">
+ <f:ajax execute="@form" event="change"
render="calendar @this"/>
+ </h:inputText>
+ <h:outputText value="Vertical offset:"/>
+ <h:inputText value="#{calendarBean.verticalOffset}">
+ <f:ajax execute="@form" event="change"
render="calendar @this"/>
+ </h:inputText>
+ </h:panelGrid>
+ </h:panelGrid>
+ <br/>
+
+ <div>
+ <a4j:log/>
+ </div>
+ <script type="text/javascript">
+ onEvent = function(event, element, data) {
+ RichFaces.log.info("jQuery Event: " + (event instanceof
jQuery.Event) + "; event: " + event.type + "; data:" + (data ||
(event['rich'] || {})['data']) + "; this.id:" + this.id +
"; component:" + (event['rich'] || {})['component'] ||
RichFaces.$(this.id));
+ };
+ //RichFaces.Event.bindById("form:calendar", "dateselect
dateselected currentdateselect currentdateselected timeselect timeselected changed clean
collapse expand complete datemouseout datemouseout", onEvent);
+ </script>
+ </h:form>
</h:body>
</html>
Modified: trunk/ui/core/ui/src/main/java/org/richfaces/component/AbstractParameter.java
===================================================================
---
trunk/ui/core/ui/src/main/java/org/richfaces/component/AbstractParameter.java 2011-01-20
18:13:25 UTC (rev 21130)
+++
trunk/ui/core/ui/src/main/java/org/richfaces/component/AbstractParameter.java 2011-01-20
18:43:56 UTC (rev 21131)
@@ -44,8 +44,8 @@
* @author shura (latest modification by $Author: alexsmirnov $)
* @version $Revision: 1.1.2.2 $ $Date: 2007/02/01 15:31:55 $
*/
-@JsfComponent(tag = @Tag(name = "param", handler =
"org.richfaces.view.facelets.html.ParameterHandler", generate = false, type =
TagType.Facelets),
- attributes = "param-assignTo-prop.xml"
+@JsfComponent(tag = @Tag(name = "param", handler =
"org.richfaces.view.facelets.html.ParameterHandler", generate = false, type =
TagType.Facelets),
+ attributes = "param-assignTo-prop.xml"
)
public abstract class AbstractParameter extends UIParameter implements ActionListener,
JavaScriptParameter {
@@ -62,7 +62,9 @@
*/
private Converter converter = null;
- /** ********************************************************* */
+ /**
+ * ********************************************************
+ */
@Attribute
public abstract boolean isNoEscape();
@@ -87,15 +89,13 @@
return converter;
}
- public void processAction(ActionEvent actionEvent)
- throws AbortProcessingException {
+ public void processAction(ActionEvent actionEvent) throws AbortProcessingException {
FacesContext context = getFacesContext();
ELContext elContext = context.getELContext();
ValueExpression updateBinding = getAssignToExpression();
if (updateBinding != null && (!updateBinding.isReadOnly(elContext))) {
- String requestValue = context.getExternalContext()
- .getRequestParameterMap().get(getName());
+ String requestValue =
context.getExternalContext().getRequestParameterMap().get(getName());
Object convertedValue = requestValue;
@@ -151,22 +151,21 @@
/** ********************************************************* */
/**
- * @param context
- * @param type
- * @return
- * @throws FacesException
+ * @param context Faces Context
+ * @param type Type of class
+ * @return converter
+ * @throws FacesException if something goes wrong
*/
- private Converter createConverter(FacesContext context, Class<?> type)
- throws FacesException {
+ private Converter createConverter(FacesContext context, Class<?> type) throws
FacesException {
Converter converter = getConverter();
if (converter == null && type != null &&
!type.equals(String.class)
- && !type.equals(Object.class)) {
+ && !type.equals(Object.class)) {
try {
converter = context.getApplication().createConverter(type);
} catch (Exception e) {
throw new FacesException(Messages.getMessage(
- Messages.NO_CONVERTER_REGISTERED, type.getName()), e);
+ Messages.NO_CONVERTER_REGISTERED, type.getName()), e);
}
}
@@ -210,8 +209,8 @@
return null;
}
- return new Object[] {
- superState,
+ return new Object[]{
+ superState,
converterState
};
}
Modified: trunk/ui/input/ui/src/main/java/org/richfaces/component/AbstractCalendar.java
===================================================================
---
trunk/ui/input/ui/src/main/java/org/richfaces/component/AbstractCalendar.java 2011-01-20
18:13:25 UTC (rev 21130)
+++
trunk/ui/input/ui/src/main/java/org/richfaces/component/AbstractCalendar.java 2011-01-20
18:43:56 UTC (rev 21131)
@@ -147,10 +147,10 @@
public abstract boolean isResetTimeOnDateSelect();
@Attribute
- public abstract String getJointPoint();
+ public abstract Positioning getJointPoint();
@Attribute
- public abstract String getDirection();
+ public abstract Positioning getDirection();
@Attribute
public abstract String getBoundaryDatesMode();
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
18:13:25 UTC (rev 21130)
+++
trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/CalendarRendererBase.java 2011-01-20
18:43:56 UTC (rev 21131)
@@ -49,6 +49,7 @@
import org.ajax4jsf.javascript.JSReference;
import org.richfaces.component.AbstractCalendar;
import org.richfaces.component.MetaComponentResolver;
+import org.richfaces.component.Positioning;
import org.richfaces.component.util.HtmlUtil;
import org.richfaces.component.util.MessageUtil;
import org.richfaces.component.util.SelectUtils;
@@ -162,10 +163,10 @@
Map<String, String> requestParameterMap =
context.getExternalContext().getRequestParameterMap();
String clientId = calendar.getClientId(context);
- String currentDateString = (String) requestParameterMap.get(clientId +
CURRENT_DATE_INPUT);
+ String currentDateString = requestParameterMap.get(clientId +
CURRENT_DATE_INPUT);
calendar.setSubmittedCurrentDate(currentDateString);
- String selectedDateString = (String) requestParameterMap.get(clientId +
"InputDate");
+ String selectedDateString = requestParameterMap.get(clientId +
"InputDate");
if (selectedDateString != null) {
calendar.setSubmittedValue(selectedDateString);
}
@@ -190,7 +191,7 @@
// skip conversion of already converted date
if (submittedValue instanceof Date) {
- return (Date) submittedValue;
+ return submittedValue;
}
// Store submitted value in the local variable as a string
@@ -278,12 +279,12 @@
calendar.setTime(date);
JSFunction result = new JSFunction("new Date");
- result.addParameter(Integer.valueOf(calendar.get(Calendar.YEAR)));
- result.addParameter(Integer.valueOf(calendar.get(Calendar.MONTH)));
- result.addParameter(Integer.valueOf(calendar.get(Calendar.DATE)));
- result.addParameter(Integer.valueOf(calendar.get(Calendar.HOUR_OF_DAY)));
- result.addParameter(Integer.valueOf(calendar.get(Calendar.MINUTE)));
- result.addParameter(new Integer(0));
+ result.addParameter(calendar.get(Calendar.YEAR));
+ result.addParameter(calendar.get(Calendar.MONTH));
+ result.addParameter(calendar.get(Calendar.DATE));
+ result.addParameter(calendar.get(Calendar.HOUR_OF_DAY));
+ result.addParameter(calendar.get(Calendar.MINUTE));
+ result.addParameter(0);
return result;
}
@@ -306,9 +307,9 @@
Calendar calendar = Calendar.getInstance();
calendar.setTime(date);
JSFunction result = new JSFunction("new Date");
- result.addParameter(Integer.valueOf(calendar.get(Calendar.YEAR)));
- result.addParameter(Integer.valueOf(calendar.get(Calendar.MONTH)));
- result.addParameter(Integer.valueOf(calendar.get(Calendar.DATE)));
+ result.addParameter(calendar.get(Calendar.YEAR));
+ result.addParameter(calendar.get(Calendar.MONTH));
+ result.addParameter(calendar.get(Calendar.DATE));
return result;
}
@@ -511,9 +512,8 @@
if (zindex < 0) {
zindex = 3;
}
-
- String style = HtmlUtil.concatStyles("z-index: " + zindex,
calendar.getStyle());
- return style;
+
+ return HtmlUtil.concatStyles("z-index: " + zindex,
calendar.getStyle());
}
public Locale getAsLocale(FacesContext facesContext, UIComponent component) {
@@ -583,29 +583,29 @@
}
return value;
}
-
- protected String getJointPointOrDefault(UIComponent component) {
- String value = "";
+
+ protected String getJointPoint(UIComponent component) {
if (component instanceof AbstractCalendar) {
- value = ((AbstractCalendar) component).getJointPoint();
- if (value == null || value.length() == 0) {
- value = "AA";
+ Positioning jointPoint = ((AbstractCalendar) component).getJointPoint();
+ if (jointPoint != null) {
+ return jointPoint.getValue();
}
}
- return value;
+ // return null to use default value on client
+ return null;
}
-
- protected String getDirectionOrDefault(UIComponent component) {
- String value = "";
+
+ protected String getDirection(UIComponent component) {
if (component instanceof AbstractCalendar) {
- value = ((AbstractCalendar) component).getDirection();
- if (value == null || value.length() == 0) {
- value = "AA";
+ Positioning direction = ((AbstractCalendar) component).getDirection();
+ if (direction != null) {
+ return direction.getValue();
}
}
- return value;
+ // return null to use default value on client
+ return null;
}
-
+
protected String getBoundaryDatesModeOrDefault(UIComponent component) {
String value = "";
if (component instanceof AbstractCalendar) {
Modified: trunk/ui/input/ui/src/main/templates/calendar.template.xml
===================================================================
--- trunk/ui/input/ui/src/main/templates/calendar.template.xml 2011-01-20 18:13:25 UTC
(rev 21130)
+++ trunk/ui/input/ui/src/main/templates/calendar.template.xml 2011-01-20 18:43:56 UTC
(rev 21131)
@@ -20,6 +20,7 @@
<cdk:superclass>org.richfaces.renderkit.CalendarRendererBase
</cdk:superclass>
<cdk:renderer-type>org.richfaces.CalendarRenderer</cdk:renderer-type>
+ <cdk:import package="org.richfaces.component"
names="Positioning" />
</cc:interface>
<cc:implementation>
<span id="#{clientId}">
@@ -73,9 +74,9 @@
<cdk:scriptOption attributes="onchange ondateselect onbeforedateselect
onbeforecurrentdateselect onhide onshow ondatemouseover ondatemouseout onclean
ontimeselect onbeforetimeselect" wrapper="eventHandler" />
<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="horizontalOffset"
value="#{component.attributes['horizontalOffset']}"
defaultValue="0"/>
+ <cdk:scriptOption name="direction"
value="#{getDirection(component)}"
defaultValue="Positioning.DEFAULT.getValue()" />
+ <cdk:scriptOption name="jointPoint"
value="#{getJointPoint(component)}"
defaultValue="Positioning.DEFAULT.getValue()" />
+ <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)}" />
Modified:
trunk/ui/iteration/ui/src/test/java/org/richfaces/renderkit/DataScrollerRenderTest.java
===================================================================
---
trunk/ui/iteration/ui/src/test/java/org/richfaces/renderkit/DataScrollerRenderTest.java 2011-01-20
18:13:25 UTC (rev 21130)
+++
trunk/ui/iteration/ui/src/test/java/org/richfaces/renderkit/DataScrollerRenderTest.java 2011-01-20
18:43:56 UTC (rev 21131)
@@ -27,7 +27,7 @@
@Before
public void setUp() {
environment = new HtmlUnitEnvironment();
- environment.withWebRoot(new File("src/test/resources"));
+ //environment.withWebRoot(new File("src/test/resources"));
environment.withResource("/WEB-INF/faces-config.xml",
"org/richfaces/renderkit/faces-config.xml");
environment.withResource("/test.xhtml",
"org/richfaces/renderkit/dataTableTest.xhtml");
environment.start();
@@ -244,7 +244,7 @@
HtmlElement ff = getFastForwardButton(page, firstScrollerId);
ff.click();
-
+
HtmlElement currentDigital1 = getDigitalButton(page, firstScrollerId, i);
assertEquals("span", currentDigital1.getNodeName());
assertEquals("rf-ds-nmb-btn rf-ds-act",
currentDigital1.getAttribute(HtmlConstants.CLASS_ATTRIBUTE).trim());