Author: nbelaevski
Date: 2007-07-05 05:13:10 -0400 (Thu, 05 Jul 2007)
New Revision: 1471
Added:
branches/3.0.2/sandbox-samples/calendar-sample/src/main/java/org/richfaces/CalendarBean.java
branches/3.0.2/sandbox-samples/calendar-sample/src/main/java/org/richfaces/CalendarDataModelItemImpl.java
branches/3.0.2/sandbox/calendar/src/main/java/org/richfaces/renderkit/CalendarDataModelItemAdaptor.java
Removed:
branches/3.0.2/sandbox-samples/calendar-sample/src/main/java/org/richfaces/Bean.java
Modified:
branches/3.0.2/sandbox-samples/calendar-sample/src/main/java/org/richfaces/CalendarDataModelImpl.java
branches/3.0.2/sandbox-samples/calendar-sample/src/main/webapp/WEB-INF/faces-config.xml
branches/3.0.2/sandbox-samples/calendar-sample/src/main/webapp/pages/index.jsp
branches/3.0.2/sandbox/calendar/src/main/config/component/calendar.xml
branches/3.0.2/sandbox/calendar/src/main/java/org/richfaces/component/UICalendar.java
branches/3.0.2/sandbox/calendar/src/main/java/org/richfaces/renderkit/CalendarRendererBase.java
branches/3.0.2/sandbox/calendar/src/main/templates/org/richfaces/htmlCalendar.jspx
branches/3.0.2/sandbox/calendar/src/test/java/org/richfaces/component/CalendarComponentTest.java
Log:
- Test Calendar Model created
- Model handling implementation started
Modified: branches/3.0.2/sandbox/calendar/src/main/config/component/calendar.xml
===================================================================
--- branches/3.0.2/sandbox/calendar/src/main/config/component/calendar.xml 2007-07-04
19:04:19 UTC (rev 1470)
+++ branches/3.0.2/sandbox/calendar/src/main/config/component/calendar.xml 2007-07-05
09:13:10 UTC (rev 1471)
@@ -42,25 +42,43 @@
</description>
<defaultvalue>"250px"</defaultvalue>
</property>
- <property>
+ <property elonly="true">
<name>data</name>
<classname>org.richfaces.component.CalendarDataModel</classname>
<description>
</description>
</property>
- <property>
+ <property elonly="true">
<name>locale</name>
<classname>java.util.Locale</classname>
<description>
</description>
<defaultvalue>getDefaultLocale()</defaultvalue>
</property>
- <property>
+ <property elonly="true">
<name>timeZone</name>
<classname>java.util.TimeZone</classname>
<description>
</description>
<defaultvalue>getDefaultTimeZone()</defaultvalue>
</property>
+ <property elonly="true">
+ <name>preloadDateRangeBegin</name>
+ <classname>java.util.Date</classname>
+ <description></description>
+ <defaultvalue>getDefaultPreloadBegin(getCurrentDate())</defaultvalue>
+ </property>
+ <property elonly="true">
+ <name>preloadDateRangeEnd</name>
+ <classname>java.util.Date</classname>
+ <description></description>
+ <defaultvalue>getDefaultPreloadEnd(getCurrentDate())</defaultvalue>
+ </property>
+ <property elonly="true">
+ <name>currentDate</name>
+ <classname>java.util.Date</classname>
+ <description></description>
+ <defaultvalue>new Date()</defaultvalue>
+ </property>
</component>
</components>
Modified:
branches/3.0.2/sandbox/calendar/src/main/java/org/richfaces/component/UICalendar.java
===================================================================
---
branches/3.0.2/sandbox/calendar/src/main/java/org/richfaces/component/UICalendar.java 2007-07-04
19:04:19 UTC (rev 1470)
+++
branches/3.0.2/sandbox/calendar/src/main/java/org/richfaces/component/UICalendar.java 2007-07-05
09:13:10 UTC (rev 1471)
@@ -21,8 +21,10 @@
package org.richfaces.component;
+import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
+import java.util.List;
import java.util.Locale;
import java.util.TimeZone;
@@ -46,6 +48,18 @@
public abstract TimeZone getTimeZone();
public abstract void setTimeZone(TimeZone timeZone);
+ public abstract Date getPreloadDateRangeBegin();
+ public abstract void setPreloadDateRangeBegin(Date date);
+
+ public abstract Date getPreloadDateRangeEnd();
+ public abstract void setPreloadDateRangeEnd(Date date);
+
+ public abstract Date getCurrentDate();
+ public abstract void setCurrentDate(Date date);
+
+ public abstract CalendarDataModel getData();
+ public abstract void setData(CalendarDataModel dataModel);
+
private int getLastDayOfWeek(Calendar calendar) {
int i = calendar.getFirstDayOfWeek();
if (i == calendar.getActualMinimum(Calendar.DAY_OF_WEEK)) {
@@ -82,7 +96,10 @@
if (facesContext != null) {
UIViewRoot viewRoot = facesContext.getViewRoot();
if (viewRoot != null) {
- return viewRoot.getLocale();
+ Locale locale = viewRoot.getLocale();
+ if (locale != null) {
+ return locale;
+ }
}
}
@@ -92,4 +109,28 @@
protected TimeZone getDefaultTimeZone() {
return TimeZone.getDefault();
}
+
+ public Date[] getPreloadDateRange() {
+ Date dateRangeBegin = this.getPreloadDateRangeBegin();
+ Date dateRangeEnd = this.getPreloadDateRangeEnd();
+
+ if (dateRangeBegin.after(dateRangeEnd)) {
+ //TODO add message
+ throw new IllegalArgumentException();
+ }
+
+ List dates = new ArrayList();
+
+ Calendar calendar = Calendar.getInstance(this.getTimeZone(), this.getLocale());
+ Calendar calendar2 = (Calendar) calendar.clone();
+ calendar.setTime(dateRangeBegin);
+ calendar2.setTime(dateRangeEnd);
+
+ do {
+ dates.add(calendar.getTime());
+ calendar.add(Calendar.DATE, 1);
+ } while (!calendar.after(calendar2));
+
+ return (Date[]) dates.toArray(new Date[dates.size()]);
+ }
}
Added:
branches/3.0.2/sandbox/calendar/src/main/java/org/richfaces/renderkit/CalendarDataModelItemAdaptor.java
===================================================================
---
branches/3.0.2/sandbox/calendar/src/main/java/org/richfaces/renderkit/CalendarDataModelItemAdaptor.java
(rev 0)
+++
branches/3.0.2/sandbox/calendar/src/main/java/org/richfaces/renderkit/CalendarDataModelItemAdaptor.java 2007-07-05
09:13:10 UTC (rev 1471)
@@ -0,0 +1,49 @@
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces 3.0 - Ajax4jsf Component Library
+ *
+ * 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 org.richfaces.renderkit;
+
+import org.richfaces.component.CalendarDataModelItem;
+
+/**
+ * @author Nick Belaevski - mailto:nbelaevski@exadel.com
+ * created 04.07.2007
+ *
+ */
+public class CalendarDataModelItemAdaptor {
+ private CalendarDataModelItem item;
+
+ public void setItem(CalendarDataModelItem item) {
+ this.item = item;
+ }
+
+ public CalendarDataModelItem getItem() {
+ return item;
+ }
+
+ public Object getDate() {
+ return CalendarRendererBase.formatDate(item.getDate());
+ }
+
+ public Object getData() {
+ return item.getData();
+ }
+}
Modified:
branches/3.0.2/sandbox/calendar/src/main/java/org/richfaces/renderkit/CalendarRendererBase.java
===================================================================
---
branches/3.0.2/sandbox/calendar/src/main/java/org/richfaces/renderkit/CalendarRendererBase.java 2007-07-04
19:04:19 UTC (rev 1470)
+++
branches/3.0.2/sandbox/calendar/src/main/java/org/richfaces/renderkit/CalendarRendererBase.java 2007-07-05
09:13:10 UTC (rev 1471)
@@ -22,11 +22,20 @@
package org.richfaces.renderkit;
import java.io.IOException;
+import java.util.AbstractCollection;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Iterator;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.context.ResponseWriter;
+import org.ajax4jsf.framework.util.javascript.JSFunction;
+import org.ajax4jsf.framework.util.javascript.ScriptUtils;
+import org.richfaces.component.CalendarDataModel;
+import org.richfaces.component.CalendarDataModelItem;
import org.richfaces.component.UICalendar;
import org.richfaces.component.util.HtmlUtil;
@@ -63,4 +72,66 @@
writeScriptBody(context, component, children);
responseWriter.write(")");
}
+
+ public void writePreloadBody(FacesContext context, UICalendar calendar) throws
IOException {
+ ResponseWriter writer = context.getResponseWriter();
+ Date[] preloadDateRange = calendar.getPreloadDateRange();
+ if (preloadDateRange != null && preloadDateRange.length != 0) {
+ CalendarDataModel calendarDataModel = (CalendarDataModel) calendar.getData();
+ if (calendarDataModel != null) {
+ CalendarDataModelItem[] calendarDataModelItems =
calendarDataModel.getData(preloadDateRange);
+
+ HashMap args = new HashMap();
+ args.put("startDate", formatDate(preloadDateRange[0]));
+ args.put("days", new AdaptingCollection(calendarDataModelItems));
+ writer.write(ScriptUtils.toScript(args));
+ }
+ }
+ }
+
+ protected static Object formatDate(Date date) {
+ 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)));
+
+ return result;
+ }
+
}
+
+class AdaptingCollection extends AbstractCollection {
+ private CalendarDataModelItem[] items;
+
+ public AdaptingCollection(CalendarDataModelItem[] items) {
+ super();
+ this.items = items;
+ }
+
+ public Iterator iterator() {
+ return new Iterator() {
+ private int idx = 0;
+ private CalendarDataModelItemAdaptor adaptor = new CalendarDataModelItemAdaptor();
+
+ public boolean hasNext() {
+ return idx < items.length;
+ }
+
+ public Object next() {
+ adaptor.setItem(items[idx++]);
+ return adaptor;
+ }
+
+ public void remove() {
+ throw new UnsupportedOperationException();
+ }
+
+ };
+ }
+
+ public int size() {
+ return this.items.length;
+ }
+}
Modified:
branches/3.0.2/sandbox/calendar/src/main/templates/org/richfaces/htmlCalendar.jspx
===================================================================
---
branches/3.0.2/sandbox/calendar/src/main/templates/org/richfaces/htmlCalendar.jspx 2007-07-04
19:04:19 UTC (rev 1470)
+++
branches/3.0.2/sandbox/calendar/src/main/templates/org/richfaces/htmlCalendar.jspx 2007-07-05
09:13:10 UTC (rev 1471)
@@ -62,7 +62,11 @@
<jsp:scriptlet>/*<![CDATA[*/
}
/*]]>*/</jsp:scriptlet>
- }).load();
+ }).load(
+ <jsp:scriptlet>/*<![CDATA[*/
+ writePreloadBody(context, component);
+ /*]]>*/</jsp:scriptlet>
+ );
</script>
</div>
</f:root>
Modified:
branches/3.0.2/sandbox/calendar/src/test/java/org/richfaces/component/CalendarComponentTest.java
===================================================================
---
branches/3.0.2/sandbox/calendar/src/test/java/org/richfaces/component/CalendarComponentTest.java 2007-07-04
19:04:19 UTC (rev 1470)
+++
branches/3.0.2/sandbox/calendar/src/test/java/org/richfaces/component/CalendarComponentTest.java 2007-07-05
09:13:10 UTC (rev 1471)
@@ -4,6 +4,7 @@
package org.richfaces.component;
import java.util.Calendar;
+import java.util.Date;
import java.util.List;
import java.util.Locale;
@@ -78,4 +79,17 @@
assertEquals(Calendar.JUNE, preloadRangeEnd.get(Calendar.MONTH));
assertEquals(30, preloadRangeEnd.get(Calendar.DATE));
}
+
+ public void testGetPreloadDateRange() throws Exception {
+ UICalendar calendar = (UICalendar)
application.createComponent(UICalendar.COMPONENT_TYPE);
+ calendar.setLocale(Locale.FRENCH);
+ Calendar calendarObject = Calendar.getInstance();
+ calendarObject.set(2007, Calendar.JUNE, 10);
+ calendar.setCurrentDate(calendarObject.getTime());
+
+ Date[] range = calendar.getPreloadDateRange();
+ assertEquals(calendar.getPreloadDateRangeBegin(), range[0]);
+ assertEquals(calendar.getPreloadDateRangeEnd(), range[range.length - 1]);
+ assertEquals(35, range.length);
+ }
}
Deleted:
branches/3.0.2/sandbox-samples/calendar-sample/src/main/java/org/richfaces/Bean.java
===================================================================
---
branches/3.0.2/sandbox-samples/calendar-sample/src/main/java/org/richfaces/Bean.java 2007-07-04
19:04:19 UTC (rev 1470)
+++
branches/3.0.2/sandbox-samples/calendar-sample/src/main/java/org/richfaces/Bean.java 2007-07-05
09:13:10 UTC (rev 1471)
@@ -1,29 +0,0 @@
-/**
- * License Agreement.
- *
- * Ajax4jsf 1.1 - 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 org.richfaces;
-/**
- * @author $Autor$
- *
- */
-public class Bean {
-
-}
\ No newline at end of file
Copied:
branches/3.0.2/sandbox-samples/calendar-sample/src/main/java/org/richfaces/CalendarBean.java
(from rev 1459,
branches/3.0.2/sandbox-samples/calendar-sample/src/main/java/org/richfaces/Bean.java)
===================================================================
---
branches/3.0.2/sandbox-samples/calendar-sample/src/main/java/org/richfaces/CalendarBean.java
(rev 0)
+++
branches/3.0.2/sandbox-samples/calendar-sample/src/main/java/org/richfaces/CalendarBean.java 2007-07-05
09:13:10 UTC (rev 1471)
@@ -0,0 +1,34 @@
+/**
+ * License Agreement.
+ *
+ * Ajax4jsf 1.1 - 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 org.richfaces;
+
+import java.util.Locale;
+
+/**
+ * @author $Autor$
+ *
+ */
+public class CalendarBean {
+ public Locale getLocale() {
+ return Locale.US;
+ }
+}
\ No newline at end of file
Modified:
branches/3.0.2/sandbox-samples/calendar-sample/src/main/java/org/richfaces/CalendarDataModelImpl.java
===================================================================
---
branches/3.0.2/sandbox-samples/calendar-sample/src/main/java/org/richfaces/CalendarDataModelImpl.java 2007-07-04
19:04:19 UTC (rev 1470)
+++
branches/3.0.2/sandbox-samples/calendar-sample/src/main/java/org/richfaces/CalendarDataModelImpl.java 2007-07-05
09:13:10 UTC (rev 1471)
@@ -1,9 +1,31 @@
/**
- *
+ * License Agreement.
+ *
+ * Ajax4jsf 1.1 - 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 org.richfaces;
+import java.text.DateFormat;
import java.util.Date;
+import java.util.HashMap;
+import java.util.Locale;
+import java.util.Map;
import org.richfaces.component.CalendarDataModel;
import org.richfaces.component.CalendarDataModelItem;
@@ -19,10 +41,33 @@
* @see org.richfaces.component.CalendarDataModel#getData(java.util.Date[])
*/
public CalendarDataModelItem[] getData(Date[] dateArray) {
- // TODO Auto-generated method stub
- return null;
+ if (dateArray == null) {
+ return null;
+ }
+
+ CalendarDataModelItem[] items = new CalendarDataModelItem[dateArray.length];
+ for (int i = 0; i < dateArray.length; i++) {
+ items[i] = createDataModelItem(dateArray[i]);
+ }
+
+ return items;
}
+ protected CalendarDataModelItem createDataModelItem(Date date) {
+ CalendarDataModelItemImpl item = new CalendarDataModelItemImpl();
+ item.setDate(date);
+ Map data = new HashMap();
+ DateFormat enFormatter = DateFormat.getDateInstance(DateFormat.MEDIUM,
Locale.ENGLISH);
+ DateFormat frFormatter = DateFormat.getDateInstance(DateFormat.MEDIUM, Locale.FRENCH);
+ DateFormat deFormatter = DateFormat.getDateInstance(DateFormat.MEDIUM, Locale.GERMAN);
+ data.put("enLabel", enFormatter.format(date));
+ data.put("frLabel", frFormatter.format(date));
+ data.put("deLabel", deFormatter.format(date));
+ item.setData(data);
+
+ return item;
+ }
+
/* (non-Javadoc)
* @see org.richfaces.component.CalendarDataModel#getToolTip(java.util.Date)
*/
Added:
branches/3.0.2/sandbox-samples/calendar-sample/src/main/java/org/richfaces/CalendarDataModelItemImpl.java
===================================================================
---
branches/3.0.2/sandbox-samples/calendar-sample/src/main/java/org/richfaces/CalendarDataModelItemImpl.java
(rev 0)
+++
branches/3.0.2/sandbox-samples/calendar-sample/src/main/java/org/richfaces/CalendarDataModelItemImpl.java 2007-07-05
09:13:10 UTC (rev 1471)
@@ -0,0 +1,118 @@
+/**
+ * License Agreement.
+ *
+ * Ajax4jsf 1.1 - 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 org.richfaces;
+
+import java.util.Date;
+
+import org.richfaces.component.CalendarDataModelItem;
+
+/**
+ * @author Nick Belaevski - mailto:nbelaevski@exadel.com
+ * created 04.07.2007
+ *
+ */
+public class CalendarDataModelItemImpl implements CalendarDataModelItem {
+
+ private Object data;
+ private Date date;
+ private String styleClass;
+ private Object toolTip;
+ private boolean enabled = true;
+
+ /* (non-Javadoc)
+ * @see org.richfaces.component.CalendarDataModelItem#getData()
+ */
+ public Object getData() {
+ return data;
+ }
+
+ /* (non-Javadoc)
+ * @see org.richfaces.component.CalendarDataModelItem#getDate()
+ */
+ public Date getDate() {
+ return date;
+ }
+
+ /* (non-Javadoc)
+ * @see org.richfaces.component.CalendarDataModelItem#getStyleClass()
+ */
+ public String getStyleClass() {
+ return styleClass;
+ }
+
+ /* (non-Javadoc)
+ * @see org.richfaces.component.CalendarDataModelItem#getToolTip()
+ */
+ public Object getToolTip() {
+ return toolTip;
+ }
+
+ /* (non-Javadoc)
+ * @see org.richfaces.component.CalendarDataModelItem#hasToolTip()
+ */
+ public boolean hasToolTip() {
+ return getToolTip() != null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.richfaces.component.CalendarDataModelItem#isEnabled()
+ */
+ public boolean isEnabled() {
+ return enabled;
+ }
+
+ /**
+ * @param data the data to set
+ */
+ public void setData(Object data) {
+ this.data = data;
+ }
+
+ /**
+ * @param date the date to set
+ */
+ public void setDate(Date date) {
+ this.date = date;
+ }
+
+ /**
+ * @param styleClass the styleClass to set
+ */
+ public void setStyleClass(String styleClass) {
+ this.styleClass = styleClass;
+ }
+
+ /**
+ * @param toolTip the toolTip to set
+ */
+ public void setToolTip(Object toolTip) {
+ this.toolTip = toolTip;
+ }
+
+ /**
+ * @param enabled the enabled to set
+ */
+ public void setEnabled(boolean enabled) {
+ this.enabled = enabled;
+ }
+
+}
Modified:
branches/3.0.2/sandbox-samples/calendar-sample/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
---
branches/3.0.2/sandbox-samples/calendar-sample/src/main/webapp/WEB-INF/faces-config.xml 2007-07-04
19:04:19 UTC (rev 1470)
+++
branches/3.0.2/sandbox-samples/calendar-sample/src/main/webapp/WEB-INF/faces-config.xml 2007-07-05
09:13:10 UTC (rev 1471)
@@ -12,4 +12,9 @@
<managed-bean-class>org.richfaces.CalendarDataModelImpl</managed-bean-class>
<managed-bean-scope>application</managed-bean-scope>
</managed-bean>
+ <managed-bean>
+ <managed-bean-name>calendarBean</managed-bean-name>
+ <managed-bean-class>org.richfaces.CalendarBean</managed-bean-class>
+ <managed-bean-scope>session</managed-bean-scope>
+ </managed-bean>
</faces-config>
Modified: branches/3.0.2/sandbox-samples/calendar-sample/src/main/webapp/pages/index.jsp
===================================================================
---
branches/3.0.2/sandbox-samples/calendar-sample/src/main/webapp/pages/index.jsp 2007-07-04
19:04:19 UTC (rev 1470)
+++
branches/3.0.2/sandbox-samples/calendar-sample/src/main/webapp/pages/index.jsp 2007-07-05
09:13:10 UTC (rev 1471)
@@ -7,7 +7,7 @@
</head>
<body>
<f:view>
- <calendar:calendar id="calendar" data="#{calendarDataModel}"
locale="en_UK">
+ <calendar:calendar id="calendar" data="#{calendarDataModel}"
locale="#{calendarBean.locale}">
<f:facet name="header">
</f:facet>
@@ -17,6 +17,12 @@
<f:facet name="weekDay">
<h:outputText style="font-style: italic;" value="{weekDay}"
/>
</f:facet>
+
+ <h:panelGrid>
+ <h:outputText value="{data.enLabel}" />
+ <h:outputText value="{data.frLabel}" />
+ <h:outputText value="{data.deLabel}" />
+ </h:panelGrid>
<h:outputText value="{day}" />
<h:inputText value="{test}" />