Author: nbelaevski
Date: 2007-09-03 14:16:18 -0400 (Mon, 03 Sep 2007)
New Revision: 2726
Modified:
trunk/ui/calendar/design/funcspec/FuncSpec - RF Calendar Component.doc
trunk/ui/calendar/src/main/config/component/calendar.xml
trunk/ui/calendar/src/main/java/org/richfaces/component/UICalendar.java
trunk/ui/calendar/src/main/java/org/richfaces/renderkit/CalendarRendererBase.java
Log:
data attribute renamed to dataModel
common AJAX attributes processing added, test application updated
Modified: trunk/ui/calendar/design/funcspec/FuncSpec - RF Calendar Component.doc
===================================================================
(Binary files differ)
Modified: trunk/ui/calendar/src/main/config/component/calendar.xml
===================================================================
--- trunk/ui/calendar/src/main/config/component/calendar.xml 2007-09-03 17:34:50 UTC (rev
2725)
+++ trunk/ui/calendar/src/main/config/component/calendar.xml 2007-09-03 18:16:18 UTC (rev
2726)
@@ -48,6 +48,7 @@
</taghandler>
-->
&ui_component_attributes;
+ &ajax_component_attributes;
&ui_input_attributes;
&ui_output_attributes;
<property>
@@ -63,7 +64,7 @@
<defaultvalue>"250px"</defaultvalue>
</property>
<property elonly="true">
- <name>data</name>
+ <name>dataModel</name>
<classname>org.richfaces.model.CalendarDataModel</classname>
<description>
Used to provide data for calendar elements. If data is
@@ -435,6 +436,13 @@
<description>valid</description>
</property>
+ <property>
+ <name>ajaxSingle</name>
+ <classname>boolean</classname>
+ <description>if "true", submits ONLY one field/link, instead of
all form controls</description>
+ <defaultvalue>true</defaultvalue>
+ </property>
+
</component>
&listeners;
</components>
Modified: trunk/ui/calendar/src/main/java/org/richfaces/component/UICalendar.java
===================================================================
--- trunk/ui/calendar/src/main/java/org/richfaces/component/UICalendar.java 2007-09-03
17:34:50 UTC (rev 2725)
+++ trunk/ui/calendar/src/main/java/org/richfaces/component/UICalendar.java 2007-09-03
18:16:18 UTC (rev 2726)
@@ -40,6 +40,8 @@
import javax.faces.event.AbortProcessingException;
import javax.faces.event.FacesEvent;
import javax.faces.event.ValueChangeEvent;
+
+import org.ajax4jsf.component.AjaxComponent;
import org.ajax4jsf.context.AjaxContext;
import org.ajax4jsf.event.AjaxEvent;
import org.apache.commons.logging.Log;
@@ -56,7 +58,7 @@
* JSF component class
*
*/
-public abstract class UICalendar extends UIInput {
+public abstract class UICalendar extends UIInput implements AjaxComponent {
public static final String COMPONENT_TYPE = "org.richfaces.Calendar";
@@ -84,9 +86,9 @@
public abstract void setCurrentDate(Date date);
- public abstract CalendarDataModel getData();
+ public abstract CalendarDataModel getDataModel();
- public abstract void setData(CalendarDataModel dataModel);
+ public abstract void setDataModel(CalendarDataModel dataModel);
public abstract String getDatePattern();
@@ -212,7 +214,7 @@
public Object getTooltip(Date date) {
- CalendarDataModel calendarDM = (CalendarDataModel) getData();
+ CalendarDataModel calendarDM = (CalendarDataModel) getDataModel();
if (calendarDM != null) {
return calendarDM.getToolTip(date);
} else {
@@ -285,6 +287,7 @@
FacesContext facesContext = FacesContext.getCurrentInstance();
AjaxContext ajaxContext = AjaxContext
.getCurrentInstance(facesContext);
+ ajaxContext.addRegionsFromComponent(this);
ajaxContext.setResponseData(getPreload());
} else {
if (event instanceof CurrentDateChangeEvent) {
@@ -361,7 +364,7 @@
public Object getPreload() {
Date[] preloadDateRange = getPreloadDateRange();
if (preloadDateRange != null && preloadDateRange.length != 0) {
- CalendarDataModel calendarDataModel = (CalendarDataModel) getData();
+ CalendarDataModel calendarDataModel = (CalendarDataModel) getDataModel();
if (calendarDataModel != null) {
CalendarDataModelItem[] calendarDataModelItems = calendarDataModel
.getData(preloadDateRange);
@@ -414,5 +417,5 @@
public void removeCurrentDateChangeListener(CurrentDateChangeListener listener) {
removeFacesListener(listener);
}
-
+
}
Modified:
trunk/ui/calendar/src/main/java/org/richfaces/renderkit/CalendarRendererBase.java
===================================================================
---
trunk/ui/calendar/src/main/java/org/richfaces/renderkit/CalendarRendererBase.java 2007-09-03
17:34:50 UTC (rev 2725)
+++
trunk/ui/calendar/src/main/java/org/richfaces/renderkit/CalendarRendererBase.java 2007-09-03
18:16:18 UTC (rev 2726)
@@ -177,9 +177,7 @@
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("single", JSReference.TRUE);
String oncomplete = AjaxRendererUtils.getAjaxOncomplete(calendar);
JSFunctionDefinition oncompleteDefinition = new JSFunctionDefinition();
Show replies by date