Author: SergeySmirnov
Date: 2007-07-31 20:05:47 -0400 (Tue, 31 Jul 2007)
New Revision: 1968
Added:
trunk/samples/richfaces-demo/src/main/webapp/richfaces/bundle.xhtml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/bundle/
trunk/samples/richfaces-demo/src/main/webapp/richfaces/bundle/source/
trunk/samples/richfaces-demo/src/main/webapp/richfaces/bundle/source/usage.html
trunk/samples/richfaces-demo/src/main/webapp/richfaces/bundle/source/usage.xhtml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/bundle/usage.xhtml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/keepAlive.xhtml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/keepAlive/
trunk/samples/richfaces-demo/src/main/webapp/richfaces/keepAlive/source/
trunk/samples/richfaces-demo/src/main/webapp/richfaces/keepAlive/source/usage.html
trunk/samples/richfaces-demo/src/main/webapp/richfaces/keepAlive/source/usage.xhtml
trunk/samples/richfaces-demo/src/main/webapp/richfaces/keepAlive/usage.xhtml
Modified:
trunk/samples/richfaces-demo/src/main/resources/org/richfaces/demo/common/components.properties
trunk/samples/richfaces-demo/src/main/webapp/richfaces/status/usage.xhtml
Log:
demo updates
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-31
23:22:14 UTC (rev 1967)
+++
trunk/samples/richfaces-demo/src/main/resources/org/richfaces/demo/common/components.properties 2007-08-01
00:05:47 UTC (rev 1968)
@@ -45,10 +45,10 @@
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
+loadBundle= ajaxResources, Bundle, /images/ico_common.gif,
/images/cn_Bundle.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/bundle.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
loadStyle= ajaxResources, Style, /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
-keepAlive= ajaxResources, Keep Alive, /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
+keepAlive= ajaxResources, Keep Alive, /images/ico_common.gif,
/images/cn_keepAlive.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/keepAlive.jsf
include= ajaxOutput, Include, /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
mediaOutput= ajaxOutput, Media Output, /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
outputPanel= ajaxOutput, Output Panel, /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/richfaces/bundle/source/usage.html
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/bundle/source/usage.html
(rev 0)
+++
trunk/samples/richfaces-demo/src/main/webapp/richfaces/bundle/source/usage.html 2007-08-01
00:05:47 UTC (rev 1968)
@@ -0,0 +1 @@
+TODO: source should be added
\ No newline at end of file
Added: trunk/samples/richfaces-demo/src/main/webapp/richfaces/bundle/source/usage.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/bundle/source/usage.xhtml
(rev 0)
+++
trunk/samples/richfaces-demo/src/main/webapp/richfaces/bundle/source/usage.xhtml 2007-08-01
00:05:47 UTC (rev 1968)
@@ -0,0 +1 @@
+x
\ No newline at end of file
Added: trunk/samples/richfaces-demo/src/main/webapp/richfaces/bundle/usage.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/bundle/usage.xhtml
(rev 0)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/bundle/usage.xhtml 2007-08-01
00:05:47 UTC (rev 1968)
@@ -0,0 +1,30 @@
+<!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:loadBundle allows to use reference to bundle messages during the Ajax
re-rendering.
+ a4j:loadBundle is a substitute for the f:loadBundle in JSF 1.1 which is not a JSF
component originally.
+ f:loadBundle is a jsp tag that load the bundle messages into the request scope when
page is
+ rendered. As soon as each Ajax request works in own request scope, the bundles loaded
with
+ f:loadBundle are unavailable.
+ </p>
+ <p>Instead of f:loadBundle that might be located anywhere on the page, the
a4j:loadBundle
+ should be declared inside the f:view (this does not matter in case on using Facelets)
+ </p>
+
+ <p>JSF 1.2 introduces the bundle registered in the faces-config.xml. This fixed
the problem
+ with f:loadBundle. Therefore, you can use this JSF 1.2 way to declare your bundles.
+ </p>
+
+ </ui:define>
+ <ui:define name="sources">
+ <h:panelGroup />
+ </ui:define>
+ </ui:composition>
+</html>
Added: trunk/samples/richfaces-demo/src/main/webapp/richfaces/bundle.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/bundle.xhtml
(rev 0)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/bundle.xhtml 2007-08-01
00:05:47 UTC (rev 1968)
@@ -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 -
Load Bundle</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/bundle/usage.xhtml"/>
+ </rich:tab>
+ </rich:tabPanel>
+ </ui:define>
+</ui:composition>
+</html>
Added: trunk/samples/richfaces-demo/src/main/webapp/richfaces/keepAlive/source/usage.html
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/keepAlive/source/usage.html
(rev 0)
+++
trunk/samples/richfaces-demo/src/main/webapp/richfaces/keepAlive/source/usage.html 2007-08-01
00:05:47 UTC (rev 1968)
@@ -0,0 +1 @@
+TODO: source should be added
\ No newline at end of file
Added:
trunk/samples/richfaces-demo/src/main/webapp/richfaces/keepAlive/source/usage.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/keepAlive/source/usage.xhtml
(rev 0)
+++
trunk/samples/richfaces-demo/src/main/webapp/richfaces/keepAlive/source/usage.xhtml 2007-08-01
00:05:47 UTC (rev 1968)
@@ -0,0 +1 @@
+x
\ No newline at end of file
Added: trunk/samples/richfaces-demo/src/main/webapp/richfaces/keepAlive/usage.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/keepAlive/usage.xhtml
(rev 0)
+++
trunk/samples/richfaces-demo/src/main/webapp/richfaces/keepAlive/usage.xhtml 2007-08-01
00:05:47 UTC (rev 1968)
@@ -0,0 +1,42 @@
+<!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:keepAlive extends the live cycle for request scope beans. In general, each Ajax
+ request works inside the own request scope. Therefore, the state of the component
+ tree rendered based on the variable from one request scope does not correspond to the
+ state of the same tree processed during the next Ajax request. This causes on of
+ the most popular problem when the form elements (buttons or fields) appear on
+ the page after the previous Ajax response will not processed during after that if
+ 'rendered' attribute reference to the request scope variable.
+ </p>
+ <p>Using the session scope variables solved the problem mentioned above.
However,
+ using a session scope might be inappropriate from the architectural point of view.
+ a4j:keepAlive allows to reuse the same value for request scope bean between
+ the several Ajax requests.
+ </p>
+ <p>
+ <b>beanName</b> attribute references to the requesr scope bean name you
want
+ to re-use during the Ajax requests.
+ </p>
+ <p><b>ajaxOnly</b> attribute is a flag that declare should the value
of the bean
+ still be available during the non-Ajax request. If ajaxOnly="true", the
request
+ scope bean will keep the same value during the Ajax requests from given page, but
+ it will be re-created as a regular request scope bean when a non-Ajax request
+ will send from this page.
+ </p>
+ <div class="sample-container" >
+ </div>
+ </ui:define>
+ <ui:define name="sources">
+ Here is a fragment of page sources for the given example:
+ <iframe
src="${facesContext.externalContext.requestContextPath}/richfaces/keepAlive/source/usage.html"
class="source_frame"/>
+ </ui:define>
+ </ui:composition>
+</html>
Added: trunk/samples/richfaces-demo/src/main/webapp/richfaces/keepAlive.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/keepAlive.xhtml
(rev 0)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/keepAlive.xhtml 2007-08-01
00:05:47 UTC (rev 1968)
@@ -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 -
Keep Bean Alive</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/keepAlive/usage.xhtml"/>
+ </rich:tab>
+ </rich:tabPanel>
+ </ui:define>
+</ui:composition>
+</html>
Modified: trunk/samples/richfaces-demo/src/main/webapp/richfaces/status/usage.xhtml
===================================================================
--- trunk/samples/richfaces-demo/src/main/webapp/richfaces/status/usage.xhtml 2007-07-31
23:22:14 UTC (rev 1967)
+++ trunk/samples/richfaces-demo/src/main/webapp/richfaces/status/usage.xhtml 2007-08-01
00:05:47 UTC (rev 1968)
@@ -17,6 +17,7 @@
<div class="sample-container" >
<h:outputText value="Ajax Status:"/>
+
<a4j:status id="commonstatus" startText="In progress..."
stopText="Complete"/>
<h:form>
@@ -40,22 +41,25 @@
<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.
+ "in progress" indicatior. The following example show the graphic image to
+ the right of the input field 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>
+ <h:panelGrid columns="2">
+
+ <h:form>
+ <a4j:commandButton eventsQueue="foo2" value="Ajax Request
2"/>
+ </h:form>
+
+ <a4j:status>
+ <f:facet name="start">
+ <h:graphicImage value="/images/ajax/ajax_process.gif"/>
+ </f:facet>
+ </a4j:status>
+
+ </h:panelGrid>
</a4j:region>
</div>
@@ -70,7 +74,7 @@
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.
+ region, the a4j:status located into. The root region has a "_viewRoot"
name.
</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
@@ -96,6 +100,7 @@
<div class="sample-container" >
+ <rich:separator height="1"/>
<a4j:region id="extr">
<h:form>
<h:outputText value="Status:" />
@@ -104,28 +109,33 @@
<h:panelGrid columns="2">
<h:outputText value="Name"/>
<h:inputText id="name" value="#{userBean.name}">
- <a4j:support event="onkeyup" />
+ <a4j:support event="onkeyup" reRender="out" />
</h:inputText>
<h:outputText value="Job"/>
<a4j:region id="intr">
<h:inputText id="job" value="#{userBean.job}">
- <a4j:support event="onkeyup" status="commonstatus"/>
+ <a4j:support event="onkeyup" reRender="out"
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>
+ <a4j:region>
+ <h:outputText id="out" value="Name: #{userBean.name}, Job:
#{userBean.job}" />
+ <br />
+ <a4j:commandButton ajaxSingle="true" value="Clean Up Form"
reRender="name, job, out" status="commonstatus">
+ <a4j:actionparam name="n" value=""
assignTo="#{userBean.name}" />
+ <a4j:actionparam name="j" value=""
assignTo="#{userBean.job}" />
+ </a4j:commandButton>
+ </a4j:region>
+
</h:form>
</a4j:region>
+ <rich:separator height="1" style="padding-top:10px"/>
</div>
</ui:define>