Author: amarkhel
Date: 2010-12-10 10:30:40 -0500 (Fri, 10 Dec 2010)
New Revision: 20499
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/input/ui/src/main/java/org/richfaces/component/AbstractCalendar.java
trunk/ui/input/ui/src/main/java/org/richfaces/view/facelets/CalendarHandler.java
Log:
RF-9991 Calendar: currentDataChangeListener attribute doesn't work
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 2010-12-10
14:44:43 UTC (rev 20498)
+++
trunk/examples/input-demo/src/main/java/org/richfaces/demo/CalendarBean.java 2010-12-10
15:30:40 UTC (rev 20499)
@@ -7,6 +7,8 @@
import javax.faces.bean.SessionScoped;
import javax.faces.event.ValueChangeEvent;
+import org.richfaces.event.CurrentDateChangeEvent;
+
@ManagedBean
@SessionScoped
public class CalendarBean {
@@ -127,5 +129,12 @@
public int getVerticalOffset() {
return verticalOffset;
}
-
+
+ public void doValueChangeListener(ValueChangeEvent event) {
+ System.out.println("doValueChangeListener: old value = " +
event.getOldValue()+", new value = "+event.getNewValue());
+ }
+
+ public void doCurrentDataChangeListener(CurrentDateChangeEvent event) {
+ System.out.println("doCurrentDataChangeListener:
"+event.getCurrentDateString());
+ }
}
\ 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 2010-12-10 14:44:43
UTC (rev 20498)
+++ trunk/examples/input-demo/src/main/webapp/examples/calendar.xhtml 2010-12-10 15:30:40
UTC (rev 20499)
@@ -61,8 +61,10 @@
firstWeekDay="4"
horizontalOffset="#{calendarBean.horizontalOffset}"
verticalOffset="#{calendarBean.verticalOffset}"
+ valueChangeListener="#{calendarBean.doValueChangeListener}"
+ currentDataChangeListener="#{calendarBean.doCurrentDataChangeListener}"
- <f:ajax event="change"
render="echo-text" />
+
</calendar:calendar>
<h:outputText id="echo-text"
value="#{calendarBean.selectedDate}" />
</h:panelGroup>
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 2010-12-10
14:44:43 UTC (rev 20498)
+++
trunk/ui/input/ui/src/main/java/org/richfaces/component/AbstractCalendar.java 2010-12-10
15:30:40 UTC (rev 20499)
@@ -465,9 +465,9 @@
facesContext.addMessage(getClientId(facesContext), message);
facesContext.renderResponse();
}
- } else {
- super.broadcast(event);
- }
+ }
+
+ super.broadcast(event);
}
@Override
Modified:
trunk/ui/input/ui/src/main/java/org/richfaces/view/facelets/CalendarHandler.java
===================================================================
---
trunk/ui/input/ui/src/main/java/org/richfaces/view/facelets/CalendarHandler.java 2010-12-10
14:44:43 UTC (rev 20498)
+++
trunk/ui/input/ui/src/main/java/org/richfaces/view/facelets/CalendarHandler.java 2010-12-10
15:30:40 UTC (rev 20499)
@@ -66,7 +66,7 @@
static class CalendarMapper extends Metadata {
- private static final Class[] SIGNATURE = new Class[] {
org.richfaces.event.CurrentDateChangeListener.class };
+ private static final Class[] SIGNATURE = new Class[] {
org.richfaces.event.CurrentDateChangeEvent.class };
private final TagAttribute attribute;