Author: SergeySmirnov
Date: 2007-07-30 21:59:25 -0400 (Mon, 30 Jul 2007)
New Revision: 1942
Added:
trunk/samples/richfaces-demo/src/main/webapp/images/ajax/
trunk/samples/richfaces-demo/src/main/webapp/images/ajax/ajax_process.gif
trunk/samples/richfaces-demo/src/main/webapp/richfaces/ajaxListener.xhtml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/ajaxListener/
trunk/samples/richfaces-demo/src/main/webapp/richfaces/ajaxListener/source/
trunk/samples/richfaces-demo/src/main/webapp/richfaces/ajaxListener/source/usage.html
trunk/samples/richfaces-demo/src/main/webapp/richfaces/ajaxListener/source/usage.xhtml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/ajaxListener/usage.xhtml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/status.xhtml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/status/
trunk/samples/richfaces-demo/src/main/webapp/richfaces/status/source/
trunk/samples/richfaces-demo/src/main/webapp/richfaces/status/source/usage.html
trunk/samples/richfaces-demo/src/main/webapp/richfaces/status/source/usage.xhtml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/status/usage.xhtml
Modified:
trunk/samples/richfaces-demo/
trunk/samples/richfaces-demo/src/main/resources/org/richfaces/demo/common/components.properties
trunk/samples/richfaces-demo/src/main/webapp/richfaces/jsFunction/usage.xhtml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/poll/usage.xhtml
Log:
Property changes on: trunk/samples/richfaces-demo
___________________________________________________________________
Name: svn:ignore
- target
.settings
.classpath
.exadelproject
.project
+ target
.settings
.classpath
.exadelproject
.project
richfaces-demo.iws
richfaces-demo.ipr
richfaces-demo.iml
Modified:
trunk/samples/richfaces-demo/src/main/resources/org/richfaces/demo/common/components.properties
===================================================================
---
trunk/samples/richfaces-demo/src/main/resources/org/richfaces/demo/common/components.properties 2007-07-30
23:45:24 UTC (rev 1941)
+++
trunk/samples/richfaces-demo/src/main/resources/org/richfaces/demo/common/components.properties 2007-07-31
01:59:25 UTC (rev 1942)
@@ -42,8 +42,8 @@
jsFunction= ajaxSupport, JavaScript Function, /images/ico_common.gif,
/images/cn_jsFunction.gif,
http://labs.jboss.com/file-access/default/members/jbossrichfaces/freezone...,
http://labs.jboss.com/file-access/default/members/jbossrichfaces/freezone...,
http://labs.jboss.com/file-access/default/members/jbossrichfaces/freezone...,
/richfaces/jsFunction.jsf
poll= ajaxSupport, Poll, /images/ico_common.gif,
/images/cn_poll.gif,
http://labs.jboss.com/file-access/default/members/jbossrichfaces/freezone...,
http://labs.jboss.com/file-access/default/members/jbossrichfaces/freezone...,
http://labs.jboss.com/file-access/default/members/jbossrichfaces/freezone...,
/richfaces/poll.jsf
push= ajaxSupport, Push, /images/ico_common.gif,
/images/cn_common.gif,
http://labs.jboss.com/file-access/default/members/jbossrichfaces/freezone...,
http://labs.jboss.com/file-access/default/members/jbossrichfaces/freezone...,
http://labs.jboss.com/file-access/default/members/jbossrichfaces/freezone...,
/richfaces/panel.jsf
-status= ajaxSupport, Status, /images/ico_common.gif,
/images/cn_common.gif,
http://labs.jboss.com/file-access/default/members/jbossrichfaces/freezone...,
http://labs.jboss.com/file-access/default/members/jbossrichfaces/freezone...,
http://labs.jboss.com/file-access/default/members/jbossrichfaces/freezone...,
/richfaces/panel.jsf
-ajaxListener= ajaxSupport, Ajax Listener, /images/ico_common.gif,
/images/cn_common.gif,
http://labs.jboss.com/file-access/default/members/jbossrichfaces/freezone...,
http://labs.jboss.com/file-access/default/members/jbossrichfaces/freezone...,
http://labs.jboss.com/file-access/default/members/jbossrichfaces/freezone...,
/richfaces/panel.jsf
+status= ajaxSupport, Status, /images/ico_common.gif,
/images/cn_status.gif,
http://labs.jboss.com/file-access/default/members/jbossrichfaces/freezone...,
http://labs.jboss.com/file-access/default/members/jbossrichfaces/freezone...,
http://labs.jboss.com/file-access/default/members/jbossrichfaces/freezone...,
/richfaces/status.jsf
+ajaxListener= ajaxSupport, Ajax Listener, /images/ico_common.gif,
/images/cn_ajaxListener.gif,
http://labs.jboss.com/file-access/default/members/jbossrichfaces/freezone...,
http://labs.jboss.com/file-access/default/members/jbossrichfaces/freezone...,
http://labs.jboss.com/file-access/default/members/jbossrichfaces/freezone...,
/richfaces/ajaxListener.jsf
region= ajaxSupport, Ajax Region, /images/ico_common.gif,
/images/cn_ajaxRegion.gif,
http://labs.jboss.com/file-access/default/members/jbossrichfaces/freezone...,
http://labs.jboss.com/file-access/default/members/jbossrichfaces/freezone...,
http://labs.jboss.com/file-access/default/members/jbossrichfaces/freezone...,
/richfaces/region.jsf
loadBundle= ajaxResources, Bundle, /images/ico_common.gif,
/images/cn_common.gif,
http://labs.jboss.com/file-access/default/members/jbossrichfaces/freezone...,
http://labs.jboss.com/file-access/default/members/jbossrichfaces/freezone...,
http://labs.jboss.com/file-access/default/members/jbossrichfaces/freezone...,
/richfaces/panel.jsf
loadScript= ajaxResources, Script, /images/ico_common.gif,
/images/cn_common.gif,
http://labs.jboss.com/file-access/default/members/jbossrichfaces/freezone...,
http://labs.jboss.com/file-access/default/members/jbossrichfaces/freezone...,
http://labs.jboss.com/file-access/default/members/jbossrichfaces/freezone...,
/richfaces/panel.jsf
Added: trunk/samples/richfaces-demo/src/main/webapp/images/ajax/ajax_process.gif
===================================================================
(Binary files differ)
Property changes on:
trunk/samples/richfaces-demo/src/main/webapp/images/ajax/ajax_process.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
trunk/samples/richfaces-demo/src/main/webapp/richfaces/ajaxListener/source/usage.html
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/ajaxListener/source/usage.html
(rev 0)
+++
trunk/samples/richfaces-demo/src/main/webapp/richfaces/ajaxListener/source/usage.html 2007-07-31
01:59:25 UTC (rev 1942)
@@ -0,0 +1 @@
+TODO: source should be added
\ No newline at end of file
Added:
trunk/samples/richfaces-demo/src/main/webapp/richfaces/ajaxListener/source/usage.xhtml
===================================================================
---
trunk/samples/richfaces-demo/src/main/webapp/richfaces/ajaxListener/source/usage.xhtml
(rev 0)
+++
trunk/samples/richfaces-demo/src/main/webapp/richfaces/ajaxListener/source/usage.xhtml 2007-07-31
01:59:25 UTC (rev 1942)
@@ -0,0 +1 @@
+x
\ No newline at end of file
Added: trunk/samples/richfaces-demo/src/main/webapp/richfaces/ajaxListener/usage.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/ajaxListener/usage.xhtml
(rev 0)
+++
trunk/samples/richfaces-demo/src/main/webapp/richfaces/ajaxListener/usage.xhtml 2007-07-31
01:59:25 UTC (rev 1942)
@@ -0,0 +1,35 @@
+<!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.ajax4jsf.org/rich">
+ <ui:composition template="/templates/component-sample.xhtml">
+ <ui:define name="sample">
+ <p>
+ Additional to the listeners provided by JSF specification, RichFaces add one more:
+ Ajax Listener (a4j:ajaxListener). Ajax Listener in invoked before the Render
Response
+ phase. Instead of Action Listener of Value Change Listener which are not invoked
when
+ Validation of Update Model phases failed, Ajax Listener is guarantied to be invoked
+ for each Ajax response. So, it is a good place for update the list of re-rendered
+ components, for example.
+ </p>
+ <p>
+ Ajax Listener is not invoked for non-Ajax request and when RichFaces works in
+ "Ajax Request generates Non-Ajax Response" mode. Therefore, Ajax Listener
invocation
+ is a good indicator that Ajax response is going to be processed.
+ </p>
+
+ <p>
+ <b>type</b> attribute defines the fully qualified Java class name for
listener. This
+ class should implement org.ajax4jsf.events.AjaxListener interface. You can access to
+ the source of the event (Ajax component) using event.getSource() call.
+ </p>
+
+
+
+ </ui:define>
+
+ </ui:composition>
+</html>
Added: trunk/samples/richfaces-demo/src/main/webapp/richfaces/ajaxListener.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/ajaxListener.xhtml
(rev 0)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/ajaxListener.xhtml 2007-07-31
01:59:25 UTC (rev 1942)
@@ -0,0 +1,17 @@
+<!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:rich="http://richfaces.ajax4jsf.org/rich">
+<ui:composition template="/templates/main.xhtml">
+ <ui:define name="title">RichFaces - Open Source Rich JSF Components -
Ajax Listener</ui:define>
+ <ui:define name="body">
+ <rich:tabPanel switchType="server" styleClass="top_tab"
contentClass="content_tab" inactiveTabClass="inactive_tab"
activeTabClass="active_tab">
+ <rich:tab label="Usage">
+ <ui:include src="/richfaces/ajaxListener/usage.xhtml"/>
+ </rich:tab>
+ </rich:tabPanel>
+ </ui:define>
+</ui:composition>
+</html>
Modified: trunk/samples/richfaces-demo/src/main/webapp/richfaces/jsFunction/usage.xhtml
===================================================================
---
trunk/samples/richfaces-demo/src/main/webapp/richfaces/jsFunction/usage.xhtml 2007-07-30
23:45:24 UTC (rev 1941)
+++
trunk/samples/richfaces-demo/src/main/webapp/richfaces/jsFunction/usage.xhtml 2007-07-31
01:59:25 UTC (rev 1942)
@@ -3,7 +3,7 @@
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/ajax"
+
xmlns:a4j="http://richfaces.org/a4j"
xmlns:rich="http://richfaces.ajax4jsf.org/rich">
<ui:composition template="/templates/component-sample.xhtml">
<ui:define name="sample">
@@ -14,8 +14,9 @@
shows how the part of the page is re-rendered when user hover over the names.
</p>
+
<div class="sample-container" >
- <rich:separator lineType="solid" height="1" />
+ <rich:separator lineType="solid" height="1" />
<table width="400">
<tbody>
<tr>
Modified: trunk/samples/richfaces-demo/src/main/webapp/richfaces/poll/usage.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/poll/usage.xhtml 2007-07-30
23:45:24 UTC (rev 1941)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/poll/usage.xhtml 2007-07-31
01:59:25 UTC (rev 1942)
@@ -1,92 +1,105 @@
<!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/ajax"
-
xmlns:rich="http://richfaces.ajax4jsf.org/rich">
- <ui:composition template="/templates/component-sample.xhtml">
- <ui:define name="sample">
-
-
- <p>a4j:poll is one of the way how you can orginize the periodical polling of
server data and
- updating the page. a4j:poll is a standard RichFaces Ajax component. So, you can use
the same
+
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.ajax4jsf.org/rich">
+<ui:composition template="/templates/component-sample.xhtml">
+ <ui:define name="sample">
+
+
+ <p>a4j:poll is one of the way how you can orginize the periodical polling of
server data and
+ updating the page. a4j:poll is a standard RichFaces Ajax component. So, you can use
the same
approach as for a4j:commandButton for example. I.e. you can use action attribute to
invoke the
actiom method and reRender attribute to update area(s) on the client when Ajax
response returns
- back. RichFaces use the standard form based request, so having the form around the
+ back. RichFaces use the standard form based request, so having the form around the
a4j:poll component is required.
- </p>
- <p>The following example shown how the date and time is updated on the page
based on the data
+ </p>
+
+ <p>The following example shown how the date and time is updated on the page based
on the data
taken from the server.</p>
- <div class="sample-container" >
- <rich:separator height="1"/>
- <a4j:region>
- <h:form>
- <a4j:poll id="poll" interval="500"
enabled="#{userBean.pollEnabled}" reRender="serverDate" />
- </h:form>
- </a4j:region>
+
+ <div class="sample-container">
+ <rich:separator height="1"/>
+ <a4j:region>
<h:form>
- <h:panelGrid columns="2" width="80%">
- <a4j:commandButton style="width:120px" id="control"
value="#{userBean.pollEnabled?'Stop':'Start'} Polling"
- reRender="poll, control">
- <a4j:actionparam name="polling"
value="#{!userBean.pollEnabled}"
- assignTo="#{userBean.pollEnabled}"/>
- </a4j:commandButton>
- <h:outputText id="serverDate" style="font-size:16px"
value="Server Date: #{userBean.date}" />
- </h:panelGrid>
+ <a4j:poll id="poll" interval="500"
enabled="#{userBean.pollEnabled}" reRender="serverDate"/>
</h:form>
- <rich:separator height="1" style="padding-top:10px"/>
- </div>
+ </a4j:region>
+ <h:form>
+ <h:panelGrid columns="2" width="80%">
+ <a4j:commandButton style="width:120px" id="control"
+ value="#{userBean.pollEnabled?'Stop':'Start'}
Polling"
+ reRender="poll, control">
+ <a4j:actionparam name="polling"
value="#{!userBean.pollEnabled}"
+ assignTo="#{userBean.pollEnabled}"/>
+ </a4j:commandButton>
+ <h:outputText id="serverDate" style="font-size:16px"
value="Server Date: #{userBean.date}"/>
+ </h:panelGrid>
+ </h:form>
+ <rich:separator height="1" style="padding-top:10px"/>
+ </div>
- <p><b>interval</b> attribute defines the interval in ms between the
previous response and the
+ <p><b>interval</b> attribute defines the interval in ms between the
previous response and the
next request. So, the total period between two request generated by a4j:poll is a sum
of interval
- and server response time.
- </p>
- <p>
- <b>timeout</b> attribute defines the time in ms how long the client will
wait for server response.
- if Ajax response does not come during this period, the connection is aborted and the
next
- request is sent. By default, the timeout is not set.
- </p>
- <p>
- <b>enabled</b> attribute defines should the a4j:poll send request or not.
You can use EL
- to point to the bean property that will be the flag. Re-render the a4j:poll component
itself
- to apply the current value. See the example how to accomplish this task.
- </p>
- <p>
- a4j:poll sends requests in parallel with user activities. The intersections
- between a4j:poll Ajax requests and other Ajax requests are possible. This might
causes
- unpredictable glitches. Especially, it is true for the earlier version of JSF
implementations
- when the parallel requests to the server was not expected. To avoid problem, try to
follow
- very simple rules:
- <ul>
- <li>Have a separate form for a4j:poll. Note, that other fields will be
included in
- request and processed on the server if the form contains not only
a4j:poll;</li>
- <li>Surround a4j:poll with a4j:region. This allow to limit the part of the
component
- tree that will be processed for each Ajax request;</li>
- <li>Try to avoid updating the same server data that might be updated by the
Ajax requests
- produced by the user activities. If you need this, be sure your code allows to
access
- the data from parallel thread without conflicts;</li>
- <li>Try to avoid re-rendering the area(s) with input field and other form
controls.
- This causes the losing of input focus because the old elements are removed before
- the update with the upcomming ones</li>
- <li>Try to re-render as little area(s) on the client as possible. Try do not
have
- intersections between the areas re-rendered by a4j:poll and areas re-rendered
- by other Ajax components;</li>
- <li>Use the eventsQueue with the same name as the name for other Ajax
components.
- This allows to queue the Ajax request and avoid updating the server side data
- and re-rendering the page area(s) in parallet;</li>
- <li>Set the reasonable interval. Note that each Ajax request restores the
session
- and component tree as well as processes the whole JSF lifecycle. Too often requests
- just degrade the overall performance of application</li>
- </ul>
-
- </p>
-
-
- </ui:define>
- <ui:define name="sources">
- Here is a fragment of page sources for the given example:
- <iframe
src="${facesContext.externalContext.requestContextPath}/richfaces/poll/source/usage.html"
class="source_frame"/>
- </ui:define>
- </ui:composition>
+ and server response time.
+ </p>
+
+ <p>
+ <b>timeout</b> attribute defines the time in ms how long the client will
wait for server response.
+ if Ajax response does not come during this period, the connection is aborted and the
next
+ request is sent. By default, the timeout is not set.
+ </p>
+
+ <p>
+ <b>enabled</b> attribute defines should the a4j:poll send request or not.
You can use EL
+ to point to the bean property that will be the flag. Re-render the a4j:poll component
itself
+ to apply the current value. See the example how to accomplish this task.
+ </p>
+
+ <p>
+ a4j:poll sends requests in parallel with user activities. The intersections
+ between a4j:poll Ajax requests and other Ajax requests are possible. This might
causes
+ unpredictable glitches. Especially, it is true for the earlier version of JSF
implementations
+ when the parallel requests to the server was not expected. To avoid problem, try to
follow
+ very simple rules:
+ </p>
+ <ul>
+ <li>Have a separate form for a4j:poll. Note, that other fields will be included
in
+ request and processed on the server if the form contains not only a4j:poll;
+ </li>
+ <li>Surround a4j:poll with a4j:region. This allow to limit the part of the
component
+ tree that will be processed for each Ajax request;
+ </li>
+ <li>Try to avoid updating the same server data that might be updated by the Ajax
requests
+ produced by the user activities. If you need this, be sure your code allows to
access
+ the data from parallel thread without conflicts;
+ </li>
+ <li>Try to avoid re-rendering the area(s) with input field and other form
controls.
+ This causes the losing of input focus because the old elements are removed before
+ the update with the upcomming ones
+ </li>
+ <li>Try to re-render as little area(s) on the client as possible. Try do not
have
+ intersections between the areas re-rendered by a4j:poll and areas re-rendered
+ by other Ajax components;
+ </li>
+ <li>Use the eventsQueue with the same name as the name for other Ajax
components.
+ This allows to queue the Ajax request and avoid updating the server side data
+ and re-rendering the page area(s) in parallet;
+ </li>
+ <li>Set the reasonable interval. Note that each Ajax request restores the
session
+ and component tree as well as processes the whole JSF lifecycle. Too often requests
+ just degrade the overall performance of application
+ </li>
+ </ul>
+
+
+ </ui:define>
+ <ui:define name="sources">
+ Here is a fragment of page sources for the given example:
+ <iframe
src="${facesContext.externalContext.requestContextPath}/richfaces/poll/source/usage.html"
+ class="source_frame"/>
+ </ui:define>
+</ui:composition>
</html>
Added: trunk/samples/richfaces-demo/src/main/webapp/richfaces/status/source/usage.html
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/status/source/usage.html
(rev 0)
+++
trunk/samples/richfaces-demo/src/main/webapp/richfaces/status/source/usage.html 2007-07-31
01:59:25 UTC (rev 1942)
@@ -0,0 +1 @@
+TODO: source should be added
\ No newline at end of file
Added: trunk/samples/richfaces-demo/src/main/webapp/richfaces/status/source/usage.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/status/source/usage.xhtml
(rev 0)
+++
trunk/samples/richfaces-demo/src/main/webapp/richfaces/status/source/usage.xhtml 2007-07-31
01:59:25 UTC (rev 1942)
@@ -0,0 +1 @@
+x
\ No newline at end of file
Added: trunk/samples/richfaces-demo/src/main/webapp/richfaces/status/usage.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/status/usage.xhtml
(rev 0)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/status/usage.xhtml 2007-07-31
01:59:25 UTC (rev 1942)
@@ -0,0 +1,137 @@
+<!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.ajax4jsf.org/rich">
+ <ui:composition template="/templates/component-sample.xhtml">
+ <ui:define name="sample">
+
+
+
+ <p>a4j:status is an indicator of Ajax request. It has two states - start and
stop. Start
+ state indicates that the Ajax request is in progress. When Ajax response comes back,
+ the component switches to the stop stage.
+ </p>
+ <div class="sample-container" >
+
+ <h:outputText value="Ajax Status:"/>
+ <a4j:status id="commonstatus" startText="In progress..."
stopText="Complete"/>
+
+ <h:form>
+ <a4j:commandButton eventsQueue="foo" value="Ajax
Request"/>
+ </h:form>
+ </div>
+ <p>
+ <b>startText</b> attribute defines the label that will be visible when
the Ajax request
+ is in progress. You can use <b>startStyle</b> or
<b>startStyleClass</b> attribuite to
+ customize style for start label. You can use <b>facet
name="start"</b> to define more enhanced
+ content for indication the start state. If facet is defined, the value of
startText
+ attribute becomes void.
+ </p>
+ <p>
+ <b>stopText</b> attribute defines the label that will be visible when the
Ajax response
+ comes back. You can use <b>stopStyle</b> or
<b>stopStyleClass</b> attribuite to
+ customize style for stop label. You can use <b>facet
name="stop"</b> to define more enhanced
+ content for indication the stop state. If facet is defined, the value of stopText
+ attribute becomes void.
+ </p>
+ <p>
+ In case of not stopText nor facet name="stop" are not defined, the stop
stage will
+ not have a visual representation. You can use this option if you want to show only
+ "in progress" indicatior. The following example show the graphic image at
the top
+ right hand corner of this page during the Ajax request.
+ </p>
+
+ <div class="sample-container" >
+ <a4j:region id="rb">
+ <a4j:status>
+ <f:facet name="start">
+ <h:graphicImage style="position:absolute;top:120px;right:10px"
value="/images/ajax/ajax_process.gif"/>
+ </f:facet>
+ </a4j:status>
+
+
+ <h:form>
+ <a4j:commandButton eventsQueue="foo2" value="Ajax Request
2"/>
+ </h:form>
+ </a4j:region>
+
+ </div>
+
+ <p>
+ By default, a4j:status works for each Ajax components inside the local region. This
+ means if you have not any region defined on the page (the whole view is a region)
and
+ have only one a4j:status on the page, this a4j:status will be activated durng
+ Ajax request sent by any of the Ajax component located on the page.
+ </p>
+ <p>
+ This client id of the a4j:status component is assigned based on the following
pattern:
+ <working region Id>:status . <b>for</b> attribute defines
the id of the region the
+ a4j:status will work for. If 'for' attribute is not defined, the working
region will be the
+ region, the a4j:status located into.
+ </p>
+ <p><b>forceId</b> attribute allows to replace the
":status" postfix of the client id with the
+ defined 'id' attribute. If 'forceId' attribute is not defined, the
defined 'id' attribute
+ will be ignored.
+ </p>
+
+ <p>
+ It is possible to have more than one a4j:status on the same page. In this case, you
need
+ to wire status components with the Ajax component used for Ajax requests producing.
+ </p>
+ <p>
+ You do not have any additional attribute defined if you have a4j:status inside each
region
+ and working for this given region. You can locate the a4j:status outside of the
region if this
+ required by page layout. In this case you have to define a 'for' attribute
explicilty. The 'for'
+ attribute should point to the id of the region it should work for.
+ </p>
+ <p>
+ Use attrubute 'status' of the Ajax component (such as a4j:commandButton,
a4j:poll etc) to point to
+ the id of the a4j:status if you want to share it between the different Ajax component
located in
+ different regions. The following example shows how to share the same a4j:status from
the Ajax
+ component located in the different region:
+ </p>
+
+
+ <div class="sample-container" >
+ <a4j:region id="extr">
+ <h:form>
+ <h:outputText value="Status:" />
+ <a4j:status id="commonstatus" startText="In Progress...."
stopText=""/>
+
+ <h:panelGrid columns="2">
+ <h:outputText value="Name"/>
+ <h:inputText id="name" value="#{userBean.name}">
+ <a4j:support event="onkeyup" />
+ </h:inputText>
+
+ <h:outputText value="Job"/>
+ <a4j:region id="intr">
+ <h:inputText id="job" value="#{userBean.job}">
+ <a4j:support event="onkeyup" status="commonstatus"/>
+ </h:inputText>
+ </a4j:region>
+
+ <h:panelGroup />
+
+ <a4j:region>
+ <a4j:commandButton ajaxSingle="true" value="Clean Up Form"
reRender="name, job">
+ <a4j:actionparam name="n" value=""
assignTo="#{userBean.name}" />
+ <a4j:actionparam name="j" value=""
assignTo="#{userBean.job}" />
+ </a4j:commandButton>
+ </a4j:region>
+
+ </h:panelGrid>
+ </h:form>
+ </a4j:region>
+ </div>
+
+ </ui:define>
+ <ui:define name="sources">
+ Here is a fragment of page sources for the given example:
+ <iframe
src="${facesContext.externalContext.requestContextPath}/richfaces/status/source/usage.html"
class="source_frame"/>
+ </ui:define>
+ </ui:composition>
+</html>
Added: trunk/samples/richfaces-demo/src/main/webapp/richfaces/status.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/status.xhtml
(rev 0)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/status.xhtml 2007-07-31
01:59:25 UTC (rev 1942)
@@ -0,0 +1,17 @@
+<!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:rich="http://richfaces.ajax4jsf.org/rich">
+<ui:composition template="/templates/main.xhtml">
+ <ui:define name="title">RichFaces - Open Source Rich JSF Components -
Ajax Status</ui:define>
+ <ui:define name="body">
+ <rich:tabPanel switchType="server" styleClass="top_tab"
contentClass="content_tab" inactiveTabClass="inactive_tab"
activeTabClass="active_tab">
+ <rich:tab label="Usage">
+ <ui:include src="/richfaces/status/usage.xhtml"/>
+ </rich:tab>
+ </rich:tabPanel>
+ </ui:define>
+</ui:composition>
+</html>