Author: nbelaevski
Date: 2007-07-23 10:14:43 -0400 (Mon, 23 Jul 2007)
New Revision: 1781
Modified:
trunk/sandbox/samples/calendar-sample/src/main/java/org/richfaces/CalendarBean.java
trunk/sandbox/ui/calendar/src/main/java/org/richfaces/component/UICalendar.java
trunk/sandbox/ui/calendar/src/main/java/org/richfaces/renderkit/CalendarRendererBase.java
Log:
Scroll submit made ajax-single
Modified:
trunk/sandbox/samples/calendar-sample/src/main/java/org/richfaces/CalendarBean.java
===================================================================
---
trunk/sandbox/samples/calendar-sample/src/main/java/org/richfaces/CalendarBean.java 2007-07-23
13:56:20 UTC (rev 1780)
+++
trunk/sandbox/samples/calendar-sample/src/main/java/org/richfaces/CalendarBean.java 2007-07-23
14:14:43 UTC (rev 1781)
@@ -37,6 +37,7 @@
private static final String[] WEEK_DAY_LABELS = new String[] {"Sun *",
"Mon +", "Tue +", "Wed +", "Thu +", "Fri
+", "Sat *"};
private Locale locale;
+
private boolean popup;
private String pattern;
private Date currentDate;
@@ -80,9 +81,11 @@
public void selectLocale(ValueChangeEvent event){
String tLocale = (String) event.getNewValue();
- String lang = tLocale.substring(0,2);
- String country = tLocale.substring(3);
- locale = new Locale(lang,country,"");
+ if (tLocale != null) {
+ String lang = tLocale.substring(0,2);
+ String country = tLocale.substring(3);
+ locale = new Locale(lang,country,"");
+ }
}
public boolean isUseCustomDayLabels() {
Modified: trunk/sandbox/ui/calendar/src/main/java/org/richfaces/component/UICalendar.java
===================================================================
---
trunk/sandbox/ui/calendar/src/main/java/org/richfaces/component/UICalendar.java 2007-07-23
13:56:20 UTC (rev 1780)
+++
trunk/sandbox/ui/calendar/src/main/java/org/richfaces/component/UICalendar.java 2007-07-23
14:14:43 UTC (rev 1781)
@@ -107,8 +107,6 @@
// currentDate processing -------------------------------------------------
- private Date currentDate = null;
-
public String getValueAsString(FacesContext context, UIComponent component)
throws IOException {
UICalendar calendar = (UICalendar) component;
@@ -155,24 +153,14 @@
}
}
-
- private int getLastDayOfWeek(Calendar calendar) {
- int i = calendar.getFirstDayOfWeek();
- if (i == calendar.getActualMinimum(Calendar.DAY_OF_WEEK)) {
- i = calendar.getActualMaximum(Calendar.DAY_OF_WEEK);
- } else {
- i--;
- }
-
- return i;
- }
-
public Date getCurrentDateOrDefault() {
Date date = getCurrentDate();
if (date != null) {
return date;
} else {
- return getCalendar().getTime();
+ Calendar calendar = getCalendar();
+ calendar.set(Calendar.DATE, 1);
+ return calendar.getTime();
}
}
Modified:
trunk/sandbox/ui/calendar/src/main/java/org/richfaces/renderkit/CalendarRendererBase.java
===================================================================
---
trunk/sandbox/ui/calendar/src/main/java/org/richfaces/renderkit/CalendarRendererBase.java 2007-07-23
13:56:20 UTC (rev 1780)
+++
trunk/sandbox/ui/calendar/src/main/java/org/richfaces/renderkit/CalendarRendererBase.java 2007-07-23
14:14:43 UTC (rev 1781)
@@ -187,9 +187,10 @@
ajaxFunction.addParameter(JSReference.NULL);
Map options = AjaxRendererUtils.buildEventOptions(context, calendar);
options.put("calendar", JSReference.THIS);
+ options.put("single", JSReference.TRUE);
// ajax single
- options.put("control", new JSReference(JSReference.THIS.toScript(),
- "id"));
+ //options.put("control", new JSReference(JSReference.THIS.toScript(),
+ // "id"));
String oncomplete = AjaxRendererUtils.getAjaxOncomplete(calendar);
JSFunctionDefinition oncompleteDefinition = new JSFunctionDefinition();
Show replies by date