Author: ilya_shaikovsky
Date: 2007-09-05 06:50:06 -0400 (Wed, 05 Sep 2007)
New Revision: 2760
Modified:
trunk/samples/richfaces-demo/src/main/webapp/richfaces/calendar/jsAPI.xhtml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/calendar/model.xhtml
Log:
Modified: trunk/samples/richfaces-demo/src/main/webapp/richfaces/calendar/jsAPI.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/calendar/jsAPI.xhtml 2007-09-05
09:57:22 UTC (rev 2759)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/calendar/jsAPI.xhtml 2007-09-05
10:50:06 UTC (rev 2760)
@@ -11,24 +11,62 @@
<p>
Calendar object JavaScript API supports the following calls:
<ul>
- <li><b>selectDate(date)</b> selects the date specified. If the date
isn't in current
- month, performs request to select</li>
- <li><b>isDateEnabled(date)</b> checks if given date is
selectable</li>
- <li><b>enableDate(date)</b> enables the given date</li>
- <li><b>disableDate(date)</b> disables the given date</li>
- <li><b>enableDates(date[])</b> enables the set of dates</li>
- <li><b>disableDates(daye[])</b> disables the set of
dates</li>
- <li><b>nextMonth()</b> navigates to next month</li>
- <li><b>nextYear()</b> navigates to next year</li>
- <li><b>prevMonth()</b> navigates to previous month </li>
- <li><b>prevYear()</b> navigates to previous year</li>
- <li><b>today()</b> selects today date</li>
- <li><b>getSelectedDate()</b> returns currently selected
date</li>
- <li><b>Object getData()</b> gets the current selected
date</li>
- <li><b>enable()</b> enables the whole calendar</li>
- <li><b>disable()</b> disables (makes it read-only) the whole
calendar </li>
- <li><b>getCurrentMonth()</b> returns number of the month currently
being viewed</li>
- <li><b>getCurrentYear()</b> returns number of the year currently
being viewed</li>
+ <li>
+ <b>getCurrentDate()</b> returns the full date currently being viewed
+ </li>
+ <li>
+ <b>getCurrentMonth(asMonthLabel)</b> returns number of the month currently
being viewed(for <b>asMonthLabel</b> true - returns month as its label)
+ </li>
+ <li>
+ <b>getCurrentYear()</b> returns number of the year currently being viewed
+ </li>
+ <li>
+ <b>changeCurrentDate(yearOffset, monthOffset)</b> sets new current month
to be displayed.
+ </li>
+ <li>
+ <b>doCollapse(), doExpand()</b> collapse or expand calendar in popup
mode.
+ </li>
+ <li>
+ <b>doSwitch()</b> inverts state for the popup calendar.
+ </li>
+ <li>
+ <b>getNextMonth(asMonthLabel), getPreviousMonth(asMonthLabel)</b> returns
previous and next month for the currently being viewed.
+ </li>
+ <li>
+ <b>getNextYear, getPreviousYear</b> returns previous and next Years for
the currently being viewed.
+ </li>
+ <li>
+ <b>getSelectedDate(), getSelectedDateString(pattern)</b> returns currently
selected date as date or as String. In case of empty pattern - return in current locale
pattern.
+ </li>
+ <li>
+ <b>nextMonth()</b> navigates to next month
+ </li>
+ <li>
+ <b>nextYear()</b> navigates to next year
+ </li>
+ <li>
+ <b>prevMonth()</b> navigates to previous month
+ </li>
+ <li>
+ <b>prevYear()</b> navigates to previous year
+ </li>
+ <li>
+ <b>render(), renderFooter(), renderOptionalFooter(), renderHeader(),
renderOptionalHeader()</b> - functions to initiate cliend side rendering of the
calendar or additional elements.
+
+ </li>
+ <li>
+ <b>resetSelectedDate()</b> - clears selected day value.
+ </li>
+ <li>
+ <b>selectDate(date, noUpdate, eventData)</b> selects the date specified.
If the date isn't in current
+ month, performs request to select. if noUpdate true - request will not fired for data
- only client side rendering will be invoked.
+ </li>
+ <li>
+ <b>showSelectedDate()</b> switch calendar to show currently selected
date.
+ </li>
+ <li>
+ <b>today(noUpdate, noHighlight)</b> switch calendar to todayDate. If
parameters - true, request will not be fired to switch, and additional highlighting will
be off.
+ </li>
</ul>
</p>
<p>
Modified: trunk/samples/richfaces-demo/src/main/webapp/richfaces/calendar/model.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/calendar/model.xhtml 2007-09-05
09:57:22 UTC (rev 2759)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/calendar/model.xhtml 2007-09-05
10:50:06 UTC (rev 2760)
@@ -1,49 +1,52 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html
xmlns="http://www.w3.org/1999/xhtml"
-
xmlns:ui="http://java.sun.com/jsf/facelets"
-
xmlns:h="http://java.sun.com/jsf/html"
-
xmlns:f="http://java.sun.com/jsf/core"
-
xmlns:a4j="http://richfaces.org/a4j"
-
xmlns:rich="http://richfaces.org/rich">
- <ui:composition template="/templates/component-sample.xhtml">
- <ui:define name="sample">
-
- <p>Calendar may use a special Data Model to provide data for element rendering.
You
- can re-define the default Calendar Model using the <b>dataModel</b>
attribute pointed
- to the object that implements CalendarDataModel interface.
- </p>
- <p>
- CalendarDataModel has the following methods:
- <ul>
- <li><b>CalendarDataModelItem[] getData(Date[]) </b>
- is called every time when components will need next block of
- CalendarDataItems. That may happens when calendar rendered, or when user navigate
- to next(previous) month or in any other case when calendar renders. This method
- will be called in Ajax mode when Calendar renders new page.</li>
- <li><b>Object getToolTip(Date)</b> uses when tool tips are displayed
in "single" mode.</li>
- </ul>
- </p>
- <p>
- CalendarDataModelItem provides the following methods:
-
- <ul>
- <li><b>Date getDate()</b> returns date that this item for, default
implementation return Date</li>
- <li><b>Boolean isEnabled()</b> returns true if date is
"selectable" on calendar, default
- implementation return true</li>
- <li><b>String getStyleClass()</b> returns String that will be
appended to style class for
- that date span. For example it may be "relevant holyday" that mean class
will
- be like "rich-cal-day relevant holyday". Default implementation return empty
string.</li>
- <li><b>Object getData()</b> returns any additional payload that must
be JSON-serialazable
- object. May be used in custom date representation on calendar (inside custom
facet).</li>
- <li><b>Boolean hasToolTip()</b> returns true if given date has an
associated with
- it tooltip data. Default implementation return false.</li>
- <li><b>Object getToolTip()</b> returns tool tip data that will be
used in "batch" tooltip
- loading mode.</li>
- </ul>
- </p>
-
-
- </ui:define>
-
- </ui:composition>
-</html>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:a4j="http://richfaces.org/a4j"
+
xmlns:rich="http://richfaces.org/rich">
+<ui:composition template="/templates/component-sample.xhtml">
+ <ui:define name="sample">
+
+ <p>Calendar may use a special Data Model to provide data for
+ element rendering. You can re-define the default Calendar Model using
+ the <b>dataModel</b> attribute pointed to the object that implements
+ CalendarDataModel interface.</p>
+ <p>CalendarDataModel has the following methods:
+ <ul>
+ <li><b>CalendarDataModelItem[] getData(Date[]) </b> is called
+ every time when components will need next block of CalendarDataItems.
+ That may happens when calendar rendered, or when user navigate to
+ next(previous) month or in any other case when calendar renders. This
+ method will be called in Ajax mode when Calendar renders new page.</li>
+ <li><b>Object getToolTip(Date)</b> uses when tool tips are
+ displayed in "single" mode.</li>
+ </ul>
+ </p>
+ <p>CalendarDataModelItem provides the following methods:
+ <ul>
+ <li><b>Boolean isEnabled()</b> returns true if date is
+ "selectable" on calendar, default implementation return true</li>
+ <li><b>String getStyleClass()</b> returns String that will be
+ appended to style class for that date span. For example it may be
+ "relevant holyday" that mean class will be like "rich-cal-day
+ relevant holyday". Default implementation return empty string.</li>
+ <li><b>Object getData()</b> returns any additional payload that
+ must be JSON-serialazable object. May be used in custom date
+ representation on calendar (inside custom facet).</li>
+ <li><b>Boolean hasToolTip()</b> returns true if given date has
+ an associated with it tooltip data. Default implementation return
+ false.</li>
+ <li><b>Object getToolTip()</b> returns tool tip data that will
+ be used in "batch" tooltip loading mode.</li>
+ </ul>
+ </p>
+ <p>
+ <b>Note: </b><i>Tooltips and date disablement isn't supported in
current implementation at client side. Will be implemented in next releases.</i>
+ </p>
+
+
+ </ui:define>
+
+</ui:composition>
+</html>