[richfaces-svn-commits] JBoss Rich Faces SVN: r2473 - in trunk/test-applications/jsp/src/main: webapp/Calendar and 1 other directory.
richfaces-svn-commits at lists.jboss.org
richfaces-svn-commits at lists.jboss.org
Fri Aug 24 09:15:04 EDT 2007
Author: ayanul
Date: 2007-08-24 09:15:03 -0400 (Fri, 24 Aug 2007)
New Revision: 2473
Added:
trunk/test-applications/jsp/src/main/java/calendar/Bean.java
Modified:
trunk/test-applications/jsp/src/main/java/calendar/CalendarBean.java
trunk/test-applications/jsp/src/main/webapp/Calendar/Calendar.jsp
Log:
http://jira.jboss.com/jira/browse/RF-697
Added: trunk/test-applications/jsp/src/main/java/calendar/Bean.java
===================================================================
--- trunk/test-applications/jsp/src/main/java/calendar/Bean.java (rev 0)
+++ trunk/test-applications/jsp/src/main/java/calendar/Bean.java 2007-08-24 13:15:03 UTC (rev 2473)
@@ -0,0 +1,29 @@
+/**
+ * License Agreement.
+ *
+ * Rich Faces - Natural Ajax for Java Server Faces (JSF)
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+package calendar;
+/**
+ * @author $Autor$
+ *
+ */
+public class Bean {
+
+}
Modified: trunk/test-applications/jsp/src/main/java/calendar/CalendarBean.java
===================================================================
--- trunk/test-applications/jsp/src/main/java/calendar/CalendarBean.java 2007-08-24 13:14:21 UTC (rev 2472)
+++ trunk/test-applications/jsp/src/main/java/calendar/CalendarBean.java 2007-08-24 13:15:03 UTC (rev 2473)
@@ -29,24 +29,30 @@
/**
* 20/07/2007
- * @author Alexej Kushunin
- * @mailto: akushunin at exadel.com
- *
+ *
+ * @author Alexej Kushunin
+ * @mailto: akushunin at exadel.com
+ *
*/
public class CalendarBean {
-
- private static final String[] WEEK_DAY_LABELS = new String[] {"Sun *", "Mon +", "Tue +", "Wed +", "Thu +", "Fri +", "Sat *"};
+
+ private static final String[] WEEK_DAY_LABELS = new String[] { "Sun *",
+ "Mon +", "Tue +", "Wed +", "Thu +", "Fri +", "Sat *" };
private Locale locale;
-
+
private boolean popup;
+ private boolean readonly;
+ private boolean showInput;
+ private boolean enableManualInput;
private String pattern;
private Date currentDate;
private Date selectedDate;
private String jointPoint;
private String direction;
-
+ private String boundary;
+
private boolean useCustomDayLabels;
-
+
public Locale getLocale() {
return locale;
}
@@ -55,7 +61,6 @@
this.locale = locale;
}
-
public boolean isPopup() {
return popup;
}
@@ -63,7 +68,6 @@
public void setPopup(boolean popup) {
this.popup = popup;
}
-
public String getPattern() {
return pattern;
@@ -74,21 +78,50 @@
}
public CalendarBean() {
-
+
locale = Locale.US;
popup = true;
pattern = "MMM d, yyyy";
jointPoint = "bottom-left";
direction = "bottom-right";
+ readonly = true;
+ enableManualInput=false;
+ showInput=true;
+ boundary = "inactive";
}
- public void selectLocale(ValueChangeEvent event){
-
+
+ public boolean isShowInput() {
+ return showInput;
+ }
+
+ public void setShowInput(boolean showInput) {
+ this.showInput = showInput;
+ }
+
+ public boolean isEnableManualInput() {
+ return enableManualInput;
+ }
+
+ public void setEnableManualInput(boolean enableManualInput) {
+ this.enableManualInput = enableManualInput;
+ }
+
+ public boolean isReadonly() {
+ return readonly;
+ }
+
+ public void setReadonly(boolean readonly) {
+ this.readonly = readonly;
+ }
+
+ public void selectLocale(ValueChangeEvent event) {
+
String tLocale = (String) event.getNewValue();
if (tLocale != null) {
- String lang = tLocale.substring(0,2);
+ String lang = tLocale.substring(0, 2);
String country = tLocale.substring(3);
- locale = new Locale(lang,country,"");
+ locale = new Locale(lang, country, "");
}
}
@@ -99,7 +132,7 @@
public void setUseCustomDayLabels(boolean useCustomDayLabels) {
this.useCustomDayLabels = useCustomDayLabels;
}
-
+
public Object getWeekDayLabelsShort() {
if (isUseCustomDayLabels()) {
return WEEK_DAY_LABELS;
@@ -111,9 +144,10 @@
public String getCurrentDateAsText() {
Date currentDate = getCurrentDate();
if (currentDate != null) {
- return DateFormat.getDateInstance(DateFormat.FULL).format(currentDate);
+ return DateFormat.getDateInstance(DateFormat.FULL).format(
+ currentDate);
}
-
+
return null;
}
@@ -132,23 +166,37 @@
public void setSelectedDate(Date selectedDate) {
this.selectedDate = selectedDate;
}
-
+
public String getJointPoint() {
return jointPoint;
}
+
public void setJointPoint(String jointPoint) {
this.jointPoint = jointPoint;
}
- public void selectJointPoint(ValueChangeEvent event){
+
+ public void selectJointPoint(ValueChangeEvent event) {
jointPoint = (String) event.getNewValue();
}
+
public String getDirection() {
return direction;
}
+
public void setDirection(String direction) {
this.direction = direction;
}
- public void selectDirection(ValueChangeEvent event){
+
+ public void selectDirection(ValueChangeEvent event) {
direction = (String) event.getNewValue();
}
-}
\ No newline at end of file
+
+ public String getBoundary() {
+ return boundary;
+ }
+
+ public void setBoundary(String boundary) {
+ this.boundary = boundary;
+ }
+
+}
Modified: trunk/test-applications/jsp/src/main/webapp/Calendar/Calendar.jsp
===================================================================
--- trunk/test-applications/jsp/src/main/webapp/Calendar/Calendar.jsp 2007-08-24 13:14:21 UTC (rev 2472)
+++ trunk/test-applications/jsp/src/main/webapp/Calendar/Calendar.jsp 2007-08-24 13:15:03 UTC (rev 2473)
@@ -1,14 +1,15 @@
-<%@ page pageEncoding="UTF-8"%>
+<%@ page pageEncoding="UTF-8" %>
-<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
+<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
-<%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
-<%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>
-<f:view>
+<%@ taglib uri="http://richfaces.org/a4j" prefix="a4j" %>
+<%@ taglib uri="http://richfaces.org/rich" prefix="rich" %>
+
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
<html>
-<head>
-<title></title>
-<style type="text/css">
+ <head>
+ <title></title>
+ <style type="text/css">
.smallText {
font-size: xx-small;
}
@@ -20,103 +21,113 @@
background-color: #0087FF;
}
</style>
-</head>
-<f:subview id="Calendar">
- <a4j:outputPanel ajaxRendered="true">
- <h:messages />
- </a4j:outputPanel>
- <h:form>
-
- <rich:calendar id="calendar" data="#{calendarDataModel}"
- locale="#{calendarBean.locale}" popup="#{calendarBean.popup}"
- datePattern="#{calendarBean.pattern}"
- weekDayLabelsShort="#{calendarBean.weekDayLabelsShort}"
- value="#{calendarBean.selectedDate}"
- currentDate="#{calendarBean.currentDate}"
- jointPoint="#{calendarBean.jointPoint}"
- direction="#{calendarBean.direction}" buttonLabel="PopUp">
-
- <f:validator validatorId="org.richfaces.CalendarValidator" />
-
- <h:panelGrid columns="2">
- <f:verbatim>
- <p style="padding: 2px;"<%-- class="largeText"--%>>{day}</p>
- </f:verbatim>
- <%-- h:panelGrid>
+ </head>
+ <body>
+ <f:view>
+ <a4j:outputPanel ajaxRendered="true">
+ <h:messages />
+ </a4j:outputPanel>
+ <h:form>
+ <rich:calendar
+ id="calendar"
+ data="#{calendarDataModel}"
+ locale="#{calendarBean.locale}"
+ popup="#{calendarBean.popup}"
+ datePattern="#{calendarBean.pattern}"
+ weekDayLabelsShort="#{calendarBean.weekDayLabelsShort}"
+ value="#{calendarBean.selectedDate}"
+ currentDate="#{calendarBean.currentDate}"
+ jointPoint="#{calendarBean.jointPoint}"
+ direction="#{calendarBean.direction}"
+ buttonLabel="PopUp"
+ enableManualInput="#{calendarBean.enableManualInput}"
+ showInput="#{calendarBean.showInput}"
+ boundaryDatesMode="#{calendarBean.boundary}">
+ <f:facet name="optionalHeader">
+ <h:outputText value="optionalHeader Facet" />
+ </f:facet>
+ <f:facet name="optionalFooter">
+ <h:outputText value="optionalFooter Facet" />
+ </f:facet>
+ <f:validator validatorId="org.richfaces.CalendarValidator" />
+
+ <h:panelGrid columns="2">
+ <f:verbatim><p style="padding: 2px;" <%-- class="largeText"--%>>{day}</p></f:verbatim>
+ <%-- h:panelGrid>
<h:outputText styleClass="smallText" value="{data.enLabel}" />
<h:outputText styleClass="smallText" value="{data.frLabel}" />
<h:outputText styleClass="smallText" value="{data.deLabel}" />
</h:panelGrid--%>
- </h:panelGrid>
- </rich:calendar>
+ </h:panelGrid>
+ </rich:calendar>
+
+ <h:panelGrid columns="2">
+ <h:outputText value="Select Locale:" />
+ <h:selectOneRadio onchange="submit()" value="en/US" valueChangeListener="#{calendarBean.selectLocale}">
+ <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="Popup Mode:" />
+ <h:selectBooleanCheckbox value="#{calendarBean.popup}" onclick="submit()"/>
+ <h:outputText value="Custom day labels:" />
+ <h:selectBooleanCheckbox value="#{calendarBean.useCustomDayLabels}" onclick="submit()"/>
+ <h:outputText value="Select Date Pattern:"/>
+ <h:selectOneMenu value="#{calendarBean.pattern}" onchange="submit()">
+ <f:selectItem itemLabel="d/M/yy" itemValue="d/M/yy"/>
+ <f:selectItem itemLabel="dd/M/yy" itemValue="dd/M/yy"/>
+ <f:selectItem itemLabel="d/MMM/y" itemValue="d/MMM/y"/>
+ <f:selectItem itemLabel="MMM d, yyyy" itemValue="MMM d, yyyy"/>
+ </h:selectOneMenu>
+ <h:inputText id="selectdate"/><h:commandButton type="button" value="Select Date" onclick="$(this.form.id+':calendar').component.selectDate(this.form[this.form.id+':selectdate'].value);"/>
+ <h:outputText value="Select Popup Joint Point:" />
+ <h:selectOneRadio onchange="submit()" value="#{calendarBean.jointPoint}" valueChangeListener="#{calendarBean.selectJointPoint}">
+ <f:selectItem itemLabel="bottom-right" itemValue="bottom-right"/>
+ <f:selectItem itemLabel="bottom-left" itemValue="bottom-left"/>
+ <f:selectItem itemLabel="top-right" itemValue="top-right"/>
+ <f:selectItem itemLabel="top-left" itemValue="top-left"/>
+ </h:selectOneRadio>
+ <h:outputText value="Select Popup Direction:" />
+ <h:selectOneRadio onchange="submit()" value="#{calendarBean.direction}" valueChangeListener="#{calendarBean.selectDirection}">
+ <f:selectItem itemLabel="bottom-right" itemValue="bottom-right"/>
+ <f:selectItem itemLabel="bottom-left" itemValue="bottom-left"/>
+ <f:selectItem itemLabel="top-right" itemValue="top-right"/>
+ <f:selectItem itemLabel="top-left" itemValue="top-left"/>
+ <f:selectItem itemLabel="auto" itemValue="auto"/>
+ </h:selectOneRadio>
+ <h:outputText value="BoundaryDatesMode:" />
+ <h:selectOneRadio onclick="submit()" value="#{calendarBean.boundary}">
+ <f:selectItem itemLabel="inactive" itemValue="inactive"/>
+ <f:selectItem itemLabel="select" itemValue="select"/>
+ <f:selectItem itemLabel="scroll" itemValue="scroll"/>
+ </h:selectOneRadio>
+ <h:outputText value="EnableManualInput:"></h:outputText>
+ <h:selectBooleanCheckbox value="#{calendarBean.enableManualInput}"
+ onclick="submit()">
+ </h:selectBooleanCheckbox>
+ <h:outputText value="ShowInput:"></h:outputText>
+ <h:selectBooleanCheckbox value="#{calendarBean.showInput}"
+ onclick="submit()">
+ </h:selectBooleanCheckbox>
+
+
- <h:panelGrid columns="2">
- <h:outputText value="Select Locale:" />
- <h:selectOneRadio onchange="submit()" value="en/US"
- valueChangeListener="#{calendarBean.selectLocale}">
- <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="Popup Mode:" />
- <h:selectBooleanCheckbox value="#{calendarBean.popup}"
- onclick="submit()" />
- <h:outputText value="Custom day labels:" />
- <h:selectBooleanCheckbox value="#{calendarBean.useCustomDayLabels}"
- onclick="submit()" />
- <h:outputText value="Select Date Pattern:" />
- <h:selectOneMenu value="#{calendarBean.pattern}" onchange="submit()">
- <f:selectItem itemLabel="d/M/yy" itemValue="d/M/yy" />
- <f:selectItem itemLabel="dd/M/yy" itemValue="dd/M/yy" />
- <f:selectItem itemLabel="d/MMM/y" itemValue="d/MMM/y" />
- <f:selectItem itemLabel="MMM d, yyyy" itemValue="MMM d, yyyy" />
- </h:selectOneMenu>
- <h:inputText id="selectdate" />
- <h:commandButton type="button" value="Select Date"
- onclick="$(this.form.id+':calendar').component.selectDate(this.form[this.form.id+':selectdate'].value);" />
- <h:outputText value="Select Popup Joint Point:" />
- <h:selectOneRadio onchange="submit()"
- value="#{calendarBean.jointPoint}"
- valueChangeListener="#{calendarBean.selectJointPoint}">
- <f:selectItem itemLabel="bottom-right" itemValue="bottom-right" />
- <f:selectItem itemLabel="bottom-left" itemValue="bottom-left" />
- <f:selectItem itemLabel="top-right" itemValue="top-right" />
- <f:selectItem itemLabel="top-left" itemValue="top-left" />
- </h:selectOneRadio>
- <h:outputText value="Select Popup Direction:" />
- <h:selectOneRadio onchange="submit()"
- value="#{calendarBean.direction}"
- valueChangeListener="#{calendarBean.selectDirection}">
- <f:selectItem itemLabel="bottom-right" itemValue="bottom-right" />
- <f:selectItem itemLabel="bottom-left" itemValue="bottom-left" />
- <f:selectItem itemLabel="top-right" itemValue="top-right" />
- <f:selectItem itemLabel="top-left" itemValue="top-left" />
- <f:selectItem itemLabel="auto" itemValue="auto" />
- </h:selectOneRadio>
-
- <%-- <h:commandButton id="calendarPopup" type="button" value="popup" onclick="$(this.form.id+':calendar').component.doSwitch();"/>
- --%>
- </h:panelGrid>
-
- <h:outputText value="Current date: " />
- <h:outputText value="#{calendarBean.currentDateAsText}" />
- <f:verbatim>
- <br />
- </f:verbatim>
- <h:outputText value="Selected date: " />
- <h:outputText value="#{calendarBean.selectedDate}" />
- <f:verbatim>
- <br />
- </f:verbatim>
-
- <h:commandButton value="Submit" />
-
- </h:form>
- <h:form>
- <h:commandLink value="Back" action="main"></h:commandLink>
- </h:form>
-</f:subview>
-</html>
-</f:view>
-
+ <%-- <h:commandButton id="calendarPopup" type="button" value="popup" onclick="$(this.form.id+':calendar').component.doSwitch();"/>
+ --%> </h:panelGrid>
+
+ <h:outputText value="Current date: "/>
+ <h:outputText value="#{calendarBean.currentDateAsText}" />
+ <f:verbatim><br /></f:verbatim>
+ <h:outputText value="Selected date: "/>
+ <h:outputText value="#{calendarBean.selectedDate}" />
+ <f:verbatim><br /></f:verbatim>
+
+ <h:commandButton value="Submit"/>
+ </h:form>
+ <h:form>
+ <h:commandLink value="Back" action="main"></h:commandLink>
+ </h:form>
+ </f:view>
+ </body>
+</html>
\ No newline at end of file
More information about the richfaces-svn-commits
mailing list