Author: SergeySmirnov
Date: 2007-09-04 20:35:04 -0400 (Tue, 04 Sep 2007)
New Revision: 2749
Added:
trunk/samples/richfaces-demo/src/main/webapp/richfaces/calendar/jsAPI.xhtml
Modified:
trunk/samples/pom.xml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/ajaxAttributes/usage.xhtml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/calendar.xhtml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/calendar/model.xhtml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/insert/usage.xhtml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/messages/examples/form.xhtml
Log:
demo update. calendar client side api is added. other minor updates
Modified: trunk/samples/pom.xml
===================================================================
--- trunk/samples/pom.xml 2007-09-04 22:55:46 UTC (rev 2748)
+++ trunk/samples/pom.xml 2007-09-05 00:35:04 UTC (rev 2749)
@@ -430,7 +430,9 @@
-->
<module>panelmenu-sample</module>
<module>rich-message-demo</module>
+ <!--
<module>scrollableDataTableDemo</module>
- <module>richfaces-ear-demo</module>
+ <module>richfaces-ear-demo</module>
+ -->
</modules>
</project>
\ No newline at end of file
Modified:
trunk/samples/richfaces-demo/src/main/webapp/richfaces/ajaxAttributes/usage.xhtml
===================================================================
---
trunk/samples/richfaces-demo/src/main/webapp/richfaces/ajaxAttributes/usage.xhtml 2007-09-04
22:55:46 UTC (rev 2748)
+++
trunk/samples/richfaces-demo/src/main/webapp/richfaces/ajaxAttributes/usage.xhtml 2007-09-05
00:35:04 UTC (rev 2749)
@@ -127,11 +127,11 @@
</h:inputText>
</pre>
</div>
- <p><b>requestDelay</b> attribute defines the time (in ms.) that
request will be wait in
+ <p><b>requestDelay</b> attribute defines the time (in ms.) that the
request will be wait in
the queue before it is ready to send. When the delay time is over, the request will be
sent to the server or removed if the newest 'similar' request is in a queue
already .
</p>
- <p><b>ignoreDupResponses</b> attributes orders to ignore the Ajax
Response produced by the
+ <p><b>ignoreDupResponses</b> attribute orders to ignore the Ajax
Response produced by the
request if the newest 'similar' request is in a queue already.
ignoreDupResponses="true"
does not cancel the request while it is processed on the server, but just allows to
avoid unnecessary updates on the client side if the response loses the actuality.
Added: trunk/samples/richfaces-demo/src/main/webapp/richfaces/calendar/jsAPI.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/calendar/jsAPI.xhtml
(rev 0)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/calendar/jsAPI.xhtml 2007-09-05
00:35:04 UTC (rev 2749)
@@ -0,0 +1,54 @@
+<!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 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>
+ </ul>
+ </p>
+ <p>
+ You can access the calendar object using
<code>$(calendar_client_id).component</code>
+ call from any place outside of the component itself.
+ </p>
+
+ <p> <dl><dt>If you develop the macrodefinition for calendar object,
you can use:</dt>
+ <dd><code>Richfaces.invokeOnComponent('calendar',element,api_function_name)</code></dd>
+ <dt>For example, the following call is
+ used on the "Next Year" button on the popup calendar panel:</dt>
+ <dd><code>Richfaces.invokeOnComponent('calendar',this,'nextYear');
</code></dd>
+ The second parameter
+ is an element inside the calendar. The Richfaces.invokeOnComponent tries to find
+ the component in the parents hierarchy with type specified with the first parameter
and
+ invokes the function defined with the third parameter.
+ </dl>
+ </p>
+
+ </ui:define>
+
+ </ui:composition>
+</html>
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-04
22:55:46 UTC (rev 2748)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/calendar/model.xhtml 2007-09-05
00:35:04 UTC (rev 2749)
@@ -8,15 +8,12 @@
<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.
- Data Model consist of two major interfaces:
- <ul>
- <li>CalendarDataModel</li>
- <li>CalendarDataModelItem</li>
- </ul>
- </p>
+ <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 functions:
+ CalendarDataModel has the following methods:
<ul>
<li><b>CalendarDataModelItem[] getData(Date[]) </b>
is called every time when components will need next block of
Modified: trunk/samples/richfaces-demo/src/main/webapp/richfaces/calendar.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/calendar.xhtml 2007-09-04
22:55:46 UTC (rev 2748)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/calendar.xhtml 2007-09-05
00:35:04 UTC (rev 2749)
@@ -13,7 +13,10 @@
</rich:tab>
<rich:tab label="Calendar Model">
<ui:include src="/richfaces/calendar/model.xhtml"/>
- </rich:tab>
+ </rich:tab>
+ <rich:tab label="Client Side API">
+ <ui:include src="/richfaces/calendar/jsAPI.xhtml"/>
+ </rich:tab>
<ui:include src="/templates/include/tagInfo.xhtml">
<ui:param name="path" value="rich/calendar"/>
</ui:include>
Modified: trunk/samples/richfaces-demo/src/main/webapp/richfaces/insert/usage.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/insert/usage.xhtml 2007-09-04
22:55:46 UTC (rev 2748)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/insert/usage.xhtml 2007-09-05
00:35:04 UTC (rev 2749)
@@ -27,6 +27,14 @@
<ui:param name="openlabel" value="View Page Source" />
</ui:include>
</div>
+
+ <p>
+ <b>errorContent</b> attribute defines the alternative content that will be
shown
+ in case rich:insert cannot read the resource defined with 'src' attribute. If
+ errorContent attribute is not defined, the component shown the actual error message in
the
+ place where the content is expected.
+ </p>
+
</ui:define>
</ui:composition>
Modified:
trunk/samples/richfaces-demo/src/main/webapp/richfaces/messages/examples/form.xhtml
===================================================================
---
trunk/samples/richfaces-demo/src/main/webapp/richfaces/messages/examples/form.xhtml 2007-09-04
22:55:46 UTC (rev 2748)
+++
trunk/samples/richfaces-demo/src/main/webapp/richfaces/messages/examples/form.xhtml 2007-09-05
00:35:04 UTC (rev 2749)
@@ -6,25 +6,30 @@
xmlns:rich="http://richfaces.org/rich">
<style type="text/css">
- .rich-message-marker img {
- padding-right:7px;
- }
- .rich-message-label {
- color:red;
- }
- .top{
- vertical-align:top;
- }
+ .rich-messages-marker img {padding-right:7px;}
+ .rich-message-label {color:red;}
+ .top {vertical-align:top;}
</style>
- <rich:panel>
+ <rich:panel style="width:400px">
<f:facet name="header">
<h:outputText value="Form Validation. Using rich:messages"/>
</f:facet>
<h:form>
- <h:panelGrid columns="2" columnClasses="top">
+ <rich:messages passedLabel="Data is allowed to be stored."
layout="list">
+ <f:facet name="header">
+ <h:outputText value="Entered Data Status:"></h:outputText>
+ </f:facet>
+ <f:facet name="passedMarker">
+ <h:graphicImage value="/images/ajax/passed.gif" />
+ </f:facet>
+ <f:facet name="errorMarker">
+ <h:graphicImage value="/images/ajax/error.gif" />
+ </f:facet>
+ </rich:messages>
+
<h:panelGrid columns="2">
<h:outputText value="Name:" />
<h:inputText label="Name" id="name" required="true"
value="#{userBean.name}">
@@ -46,18 +51,6 @@
<a4j:commandButton value="Validate" />
</f:facet>
</h:panelGrid>
- <rich:messages passedLabel="Data is allowed to be stored."
layout="list">
- <f:facet name="header">
- <h:outputText value="Entered Data Status:"></h:outputText>
- </f:facet>
- <f:facet name="passedMarker">
- <h:graphicImage value="/images/ajax/passed.gif" />
- </f:facet>
- <f:facet name="errorMarker">
- <h:graphicImage value="/images/ajax/error.gif" />
- </f:facet>
- </rich:messages>
- </h:panelGrid>
</h:form>
</rich:panel>
</ui:composition>
\ No newline at end of file