Author: ilya_shaikovsky
Date: 2009-08-27 11:07:55 -0400 (Thu, 27 Aug 2009)
New Revision: 15347
Added:
root/examples/trunk/richfaces-demo/src/main/java/org/richfaces/demo/outputPanel/
root/examples/trunk/richfaces-demo/src/main/java/org/richfaces/demo/outputPanel/OutputPanelBean.java
root/examples/trunk/richfaces-demo/src/main/webapp/WEB-INF/faces-config.xml
root/examples/trunk/richfaces-demo/src/main/webapp/resources/rich/css/message.css
root/examples/trunk/richfaces-demo/src/main/webapp/resources/rich/css/messages.css
root/examples/trunk/richfaces-demo/src/main/webapp/resources/rich/message.xhtml
root/examples/trunk/richfaces-demo/src/main/webapp/resources/rich/messages.xhtml
root/examples/trunk/richfaces-demo/src/main/webapp/richfaces/ajax.xhtml
root/examples/trunk/richfaces-demo/src/main/webapp/richfaces/ajax/
root/examples/trunk/richfaces-demo/src/main/webapp/richfaces/ajax/ajax.xhtml
root/examples/trunk/richfaces-demo/src/main/webapp/richfaces/outputPanel/compositemessages.xhtml
root/examples/trunk/richfaces-demo/src/main/webapp/richfaces/status/referencedusage.xhtml
Modified:
root/examples/trunk/richfaces-demo/src/main/java/org/richfaces/demo/push/ChoicesBean.java
root/examples/trunk/richfaces-demo/src/main/webapp/resources/rich/css/page.css
root/examples/trunk/richfaces-demo/src/main/webapp/richfaces/commandButton.xhtml
root/examples/trunk/richfaces-demo/src/main/webapp/richfaces/commandLink.xhtml
root/examples/trunk/richfaces-demo/src/main/webapp/richfaces/jsFunction.xhtml
root/examples/trunk/richfaces-demo/src/main/webapp/richfaces/log.xhtml
root/examples/trunk/richfaces-demo/src/main/webapp/richfaces/mediaOutput.xhtml
root/examples/trunk/richfaces-demo/src/main/webapp/richfaces/outputPanel.xhtml
root/examples/trunk/richfaces-demo/src/main/webapp/richfaces/outputPanel/usage.xhtml
root/examples/trunk/richfaces-demo/src/main/webapp/richfaces/push.xhtml
root/examples/trunk/richfaces-demo/src/main/webapp/richfaces/push/usage.xhtml
root/examples/trunk/richfaces-demo/src/main/webapp/richfaces/status.xhtml
root/examples/trunk/richfaces-demo/src/main/webapp/templates/includes/navigation.xhtml
Log:
Added:
root/examples/trunk/richfaces-demo/src/main/java/org/richfaces/demo/outputPanel/OutputPanelBean.java
===================================================================
---
root/examples/trunk/richfaces-demo/src/main/java/org/richfaces/demo/outputPanel/OutputPanelBean.java
(rev 0)
+++
root/examples/trunk/richfaces-demo/src/main/java/org/richfaces/demo/outputPanel/OutputPanelBean.java 2009-08-27
15:07:55 UTC (rev 15347)
@@ -0,0 +1,13 @@
+package org.richfaces.demo.outputPanel;
+
+public class OutputPanelBean {
+ private String text;
+
+ public String getText() {
+ return text;
+ }
+
+ public void setText(String text) {
+ this.text = text;
+ }
+}
Modified:
root/examples/trunk/richfaces-demo/src/main/java/org/richfaces/demo/push/ChoicesBean.java
===================================================================
---
root/examples/trunk/richfaces-demo/src/main/java/org/richfaces/demo/push/ChoicesBean.java 2009-08-27
15:06:55 UTC (rev 15346)
+++
root/examples/trunk/richfaces-demo/src/main/java/org/richfaces/demo/push/ChoicesBean.java 2009-08-27
15:07:55 UTC (rev 15347)
@@ -98,7 +98,7 @@
}
System.out.println("New Event!");
listener.onEvent(new EventObject(this));
- Thread.sleep(10000);
+ Thread.sleep(5000);
} catch (InterruptedException e) {
e.printStackTrace();
}
Added: root/examples/trunk/richfaces-demo/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
--- root/examples/trunk/richfaces-demo/src/main/webapp/WEB-INF/faces-config.xml
(rev 0)
+++ root/examples/trunk/richfaces-demo/src/main/webapp/WEB-INF/faces-config.xml 2009-08-27
15:07:55 UTC (rev 15347)
@@ -0,0 +1,25 @@
+<?xml version='1.0' encoding='UTF-8'?>
+
+<faces-config
xmlns="http://java.sun.com/xml/ns/javaee"
+ version="2.0">
+
+ <application>
+ <!-- system-event-listener>
+ <system-event-listener-class>org.richfaces.resource.MapBasedResourceCodecListener</system-event-listener-class>
+ <system-event-class>javax.faces.event.PostConstructApplicationEvent</system-event-class>
+ </system-event-listener -->
+ </application>
+
+ <managed-bean>
+ <managed-bean-name>opBean1</managed-bean-name>
+ <managed-bean-class>org.richfaces.demo.outputPanel.OutputPanelBean</managed-bean-class>
+ <managed-bean-scope>request</managed-bean-scope>
+ </managed-bean>
+ <managed-bean>
+ <managed-bean-name>opBean2</managed-bean-name>
+ <managed-bean-class>org.richfaces.demo.outputPanel.OutputPanelBean</managed-bean-class>
+ <managed-bean-scope>request</managed-bean-scope>
+ </managed-bean>
+
+
+</faces-config>
\ No newline at end of file
Added: root/examples/trunk/richfaces-demo/src/main/webapp/resources/rich/css/message.css
===================================================================
--- root/examples/trunk/richfaces-demo/src/main/webapp/resources/rich/css/message.css
(rev 0)
+++
root/examples/trunk/richfaces-demo/src/main/webapp/resources/rich/css/message.css 2009-08-27
15:07:55 UTC (rev 15347)
@@ -0,0 +1,3 @@
+rich-message{
+ color:red;
+}
\ No newline at end of file
Added: root/examples/trunk/richfaces-demo/src/main/webapp/resources/rich/css/messages.css
===================================================================
--- root/examples/trunk/richfaces-demo/src/main/webapp/resources/rich/css/messages.css
(rev 0)
+++
root/examples/trunk/richfaces-demo/src/main/webapp/resources/rich/css/messages.css 2009-08-27
15:07:55 UTC (rev 15347)
@@ -0,0 +1,3 @@
+rich-messages{
+ color:red;
+}
\ No newline at end of file
Modified: root/examples/trunk/richfaces-demo/src/main/webapp/resources/rich/css/page.css
===================================================================
---
root/examples/trunk/richfaces-demo/src/main/webapp/resources/rich/css/page.css 2009-08-27
15:06:55 UTC (rev 15346)
+++
root/examples/trunk/richfaces-demo/src/main/webapp/resources/rich/css/page.css 2009-08-27
15:07:55 UTC (rev 15347)
@@ -3,6 +3,9 @@
background: #FFFFFF;
margin:0px;
}
+*{
+ font-size:11px;
+}
.header_bg{
background-image:url(#{resource['rich/img/header_background.png']});
border-bottom:1px solid;
Added: root/examples/trunk/richfaces-demo/src/main/webapp/resources/rich/message.xhtml
===================================================================
--- root/examples/trunk/richfaces-demo/src/main/webapp/resources/rich/message.xhtml
(rev 0)
+++
root/examples/trunk/richfaces-demo/src/main/webapp/resources/rich/message.xhtml 2009-08-27
15:07:55 UTC (rev 15347)
@@ -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:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:c="http://java.sun.com/jsp/jstl/core"
+
xmlns:composite="http://java.sun.com/jsf/composite"
+
xmlns:a4j="http://richfaces.org/a4j">
+<head>
+<title>panel</title>
+</head>
+<body>
+
+<composite:interface>
+ <composite:attribute name="for" required="true" />
+ <composite:attribute name="style" required="false" />
+ <composite:attribute name="styleClass" required="false" />
+</composite:interface>
+
+<composite:implementation>
+ <h:outputStylesheet name="rich/css/message.css" />
+ <a4j:outputPanel ajaxRendered="true" layout="none">
+ <h:message for="#{cc.attrs.for}"
showDetail="#{cc.attrs.showDetails}"
+ showSummary="#{cc.attrs.showSummary}" style="#{cc.attrs.style}"
+ styleClass="rich-message #{cc.attrs.styleClass}" />
+ </a4j:outputPanel>
+</composite:implementation>
+</body>
+</html>
Added: root/examples/trunk/richfaces-demo/src/main/webapp/resources/rich/messages.xhtml
===================================================================
--- root/examples/trunk/richfaces-demo/src/main/webapp/resources/rich/messages.xhtml
(rev 0)
+++
root/examples/trunk/richfaces-demo/src/main/webapp/resources/rich/messages.xhtml 2009-08-27
15:07:55 UTC (rev 15347)
@@ -0,0 +1,29 @@
+<!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:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:c="http://java.sun.com/jsp/jstl/core"
+
xmlns:composite="http://java.sun.com/jsf/composite"
+
xmlns:a4j="http://richfaces.org/a4j">
+<head>
+<title>panel</title>
+</head>
+<body>
+
+<composite:interface>
+ <composite:attribute name="style" required="false" />
+ <composite:attribute name="styleClass" required="false" />
+</composite:interface>
+
+<composite:implementation>
+ <h:outputStylesheet name="rich/css/messages.css" />
+ <a4j:outputPanel ajaxRendered="true" layout="none">
+ <h:messages layout="#{cc.attrs.layout}"
+ showSummary="true" style="#{cc.attrs.style}"
+ styleClass="rich-message #{cc.attrs.styleClass}" />
+ </a4j:outputPanel>
+</composite:implementation>
+</body>
+</html>
Added: root/examples/trunk/richfaces-demo/src/main/webapp/richfaces/ajax/ajax.xhtml
===================================================================
--- root/examples/trunk/richfaces-demo/src/main/webapp/richfaces/ajax/ajax.xhtml
(rev 0)
+++
root/examples/trunk/richfaces-demo/src/main/webapp/richfaces/ajax/ajax.xhtml 2009-08-27
15:07:55 UTC (rev 15347)
@@ -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:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:a4j="http://richfaces.org/a4j">
+
+ <ui:composition>
+ <h:form>
+ <h:inputText value="#{userBean.name}">
+ <a4j:ajax event="keyup" render="out"/>
+ </h:inputText>
+ <h:outputText value="#{userBean.name}" id="out"/>
+ </h:form>
+ </ui:composition>
+
+</html>
\ No newline at end of file
Added: root/examples/trunk/richfaces-demo/src/main/webapp/richfaces/ajax.xhtml
===================================================================
--- root/examples/trunk/richfaces-demo/src/main/webapp/richfaces/ajax.xhtml
(rev 0)
+++ root/examples/trunk/richfaces-demo/src/main/webapp/richfaces/ajax.xhtml 2009-08-27
15:07:55 UTC (rev 15347)
@@ -0,0 +1,20 @@
+<!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:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:ui="http://java.sun.com/jsf/facelets">
+
+ <ui:composition template="/templates/main.xhtml">
+ <ui:define name="body">
+ <p>
+ The behavior that adds javascript call for sending Ajax request
+ to specified event on parent component
+ </p>
+ <fieldset>
+ <legend>Simple sample</legend>
+ <ui:include src="/richfaces/ajax/ajax.xhtml" />
+ </fieldset>
+ </ui:define>
+ </ui:composition>
+
+</html>
\ No newline at end of file
Modified:
root/examples/trunk/richfaces-demo/src/main/webapp/richfaces/commandButton.xhtml
===================================================================
---
root/examples/trunk/richfaces-demo/src/main/webapp/richfaces/commandButton.xhtml 2009-08-27
15:06:55 UTC (rev 15346)
+++
root/examples/trunk/richfaces-demo/src/main/webapp/richfaces/commandButton.xhtml 2009-08-27
15:07:55 UTC (rev 15347)
@@ -7,7 +7,8 @@
<ui:composition template="/templates/main.xhtml">
<ui:define name="body">
<p>
- Description for commandButton goes there.
+ The combination similar to h:commandButton with f:ajax. Inherits all
+ a4j:ajax special options.
</p>
<fieldset>
<legend>commandButton Sample</legend>
Modified: root/examples/trunk/richfaces-demo/src/main/webapp/richfaces/commandLink.xhtml
===================================================================
---
root/examples/trunk/richfaces-demo/src/main/webapp/richfaces/commandLink.xhtml 2009-08-27
15:06:55 UTC (rev 15346)
+++
root/examples/trunk/richfaces-demo/src/main/webapp/richfaces/commandLink.xhtml 2009-08-27
15:07:55 UTC (rev 15347)
@@ -7,7 +7,8 @@
<ui:composition template="/templates/main.xhtml">
<ui:define name="body">
<p>
- Description for commandLink goes there.
+ The combination similar to h:commandLink with f:ajax. Inherits all
+ a4j:ajax special options.
</p>
<fieldset>
<legend>commandLink Sample</legend>
Modified: root/examples/trunk/richfaces-demo/src/main/webapp/richfaces/jsFunction.xhtml
===================================================================
---
root/examples/trunk/richfaces-demo/src/main/webapp/richfaces/jsFunction.xhtml 2009-08-27
15:06:55 UTC (rev 15346)
+++
root/examples/trunk/richfaces-demo/src/main/webapp/richfaces/jsFunction.xhtml 2009-08-27
15:07:55 UTC (rev 15347)
@@ -6,9 +6,14 @@
<ui:composition template="/templates/main.xhtml">
<ui:define name="body">
- <p>
- Description for JS Function goes there.
- </p>
+
+ <p><b>a4j:jsFunction</b> component also designed to send Ajax
requests, but allows to perform
+ an the requests from a Javascript code directly. The component sends a request using
+ a standard JSF approach, so the JSF form is required. The following example
+ shows how the part of a page is re-rendered when a user hovers over the names.
+ </p>
+
+
<fieldset>
<legend>JS Function Sample</legend>
<ui:include src="/richfaces/jsFunction/usage.xhtml" />
Modified: root/examples/trunk/richfaces-demo/src/main/webapp/richfaces/log.xhtml
===================================================================
--- root/examples/trunk/richfaces-demo/src/main/webapp/richfaces/log.xhtml 2009-08-27
15:06:55 UTC (rev 15346)
+++ root/examples/trunk/richfaces-demo/src/main/webapp/richfaces/log.xhtml 2009-08-27
15:07:55 UTC (rev 15347)
@@ -6,8 +6,10 @@
<ui:composition template="/templates/main.xhtml">
<ui:define name="body">
- <p>
- Description for log goes there.
+ <p>
+ Log component allows you to inspect client side activities
+ during an Ajax request. It shows reuqest data, response data, DOM
+ tree changes on update and other useful debug information.
</p>
<fieldset>
<legend>log Sample</legend>
Modified: root/examples/trunk/richfaces-demo/src/main/webapp/richfaces/mediaOutput.xhtml
===================================================================
---
root/examples/trunk/richfaces-demo/src/main/webapp/richfaces/mediaOutput.xhtml 2009-08-27
15:06:55 UTC (rev 15346)
+++
root/examples/trunk/richfaces-demo/src/main/webapp/richfaces/mediaOutput.xhtml 2009-08-27
15:07:55 UTC (rev 15347)
@@ -6,9 +6,28 @@
<ui:composition template="/templates/main.xhtml">
<ui:define name="body">
- <p>
- Description for Media output goes there.
- </p>
+ <p>a4j:mediaOutput allows to generate images, video, sounds and other binary
+ resources defined by a user on-the-fly.
+ </p>
+ <p><b>createContent</b> attribute references to the method that will
be used
+ for content creating. The method accepts two parameters. The first parameter
+ has an OutputStream type. It is a reference to the steam that should be used for
output.
+ The second parameter is a reference to a 'value' attribute of the component.
+ </p>
+ <p>
+ <b>value</b> attribute references to data that can be used as input data
for a content
+ creator method. The data should be serializable because it is encoded to the URL
+ of the resource.
+ </p>
+ <p>
+ <b>mimeType</b> attribute defines the type of output content. It is used
to define
+ the corresponded type in the header of an HTTP response.
+ </p>
+ <p>
+ <b>cacheable</b> attribute is a flag that defines the caching strategy. If
'cacheable'
+ is set to false, the response will not be cached. If it is set to true, it will be
cached
+ and the serialized value of 'value' attribute plays the role of a cache key.
+ </p>
<fieldset>
<legend>Image output</legend>
<ui:include src="/richfaces/mediaOutput/imgUsage.xhtml" />
Added:
root/examples/trunk/richfaces-demo/src/main/webapp/richfaces/outputPanel/compositemessages.xhtml
===================================================================
---
root/examples/trunk/richfaces-demo/src/main/webapp/richfaces/outputPanel/compositemessages.xhtml
(rev 0)
+++
root/examples/trunk/richfaces-demo/src/main/webapp/richfaces/outputPanel/compositemessages.xhtml 2009-08-27
15:07:55 UTC (rev 15347)
@@ -0,0 +1,34 @@
+<!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:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:a4j="http://richfaces.org/a4j"
+
xmlns:rich="http://java.sun.com/jsf/composite/rich">
+
+ <ui:composition>
+ <h:form>
+ <rich:panel id="psnel">
+ <f:facet name="header">
+ <h:outputText value="User Details Panel" />
+ </f:facet>
+ <h:panelGrid columns="2">
+ <h:panelGrid columns="2">
+ <h:outputText value="User name:" />
+ <h:inputText value="#{userBean.name}" required="true"
label="Name">
+ <f:validateLength minimum="3" maximum="12"/>
+ </h:inputText>
+ <h:outputText value="Adress:" />
+ <h:inputTextarea value="#{userBean.address}" label="Adress"
required="true">
+ <f:validateLength maximum="100"/>
+ </h:inputTextarea>
+ </h:panelGrid>
+ <rich:messages/>
+ </h:panelGrid>
+ <a4j:commandButton value="Submit" type="button"
action="#{userBean.store}" render="out"/>
+ <h:outputText value="#{userBean.recordStatus}" id="out"/>
+ </rich:panel>
+ </h:form>
+ </ui:composition>
+
+</html>
\ No newline at end of file
Modified:
root/examples/trunk/richfaces-demo/src/main/webapp/richfaces/outputPanel/usage.xhtml
===================================================================
---
root/examples/trunk/richfaces-demo/src/main/webapp/richfaces/outputPanel/usage.xhtml 2009-08-27
15:06:55 UTC (rev 15346)
+++
root/examples/trunk/richfaces-demo/src/main/webapp/richfaces/outputPanel/usage.xhtml 2009-08-27
15:07:55 UTC (rev 15347)
@@ -7,49 +7,64 @@
xmlns:a4j="http://richfaces.org/a4j">
<ui:composition>
- <h:form>
- <rich:panel>
- <f:facet name="header">
- <h:outputText value="Register form" />
- </f:facet>
- <h:panelGrid columns="3">
- <h:outputText value="Name:" />
- <h:inputText value="#{userBean.name}" required="true"
- validatorMessage="Nickname should countains of at least 3 characters"
- id="name">
- <a4j:ajax event="blur" execute="@this"
render="namemessage"/>
- <f:validateLength minimum="3" />
- </h:inputText>
- <a4j:outputPanel layout="block" id="namemessage">
- <h:message for="name" style="color:red"/>
- </a4j:outputPanel>
- <h:outputText value="Password" />
- <h:inputSecret value="#{userBean.password}" id="pass"
required="true"
- validatorMessage="Password should consist of at least 6 characters"
>
- <a4j:ajax event="blur" execute="@this"
render="passmessage"/>
- <f:validateLength minimum="6"/>
- </h:inputSecret>
- <a4j:outputPanel layout="block" id="passmessage">
- <h:message for="pass" style="color:red"/>
- </a4j:outputPanel>
- <h:outputText value="Age:" />
- <h:inputText value="#{userBean.age}" id="age"
required="true"
- validatorMessage="You must be 21 or older to register">
- <f:validateLongRange minimum="21" />
- <a4j:ajax event="blur" execute="@this"
render="agemessage"/>
- </h:inputText>
- <a4j:outputPanel layout="block" id="agemessage">
- <h:message for="age" style="color:red"/>
- </a4j:outputPanel>
- </h:panelGrid>
- <h:commandButton action="#{userBean.store}" value="Register"
type="button">
- <a4j:ajax execute="@form"/>
- </h:commandButton>
- <a4j:outputPanel ajaxRendered="true">
- <h:outputText value="#{userBean.recordStatus}" id="out"
style="color:green;"/>
- </a4j:outputPanel>
- </rich:panel>
- </h:form>
+ <style type="text/css">
+ .col {
+ width:50%;
+ padding:10px;
+ padding: 0px 30px 0px 0px;
+ vertical-align: top;
+ }
+ </style>
+ <h:panelGrid columns="2" width="100%"
columnClasses="col">
+
+ <f:verbatim>
+ This code does not work as expected. The expected echo text does not
appear
+ below even the condition for <code>'renderer'</code>
returns <code>true</code>.
+ Also, the error message does not appear when the length of the text
reaches the limit.
+ </f:verbatim>
+ <f:verbatim>
+ This code works properly. The <code>h:message</code> is
marked for update during
+ each Ajaxrequest/response. The place for bottom label is reserved with
+ <code>outputPanel</code> while the component is not
rendered.
+ </f:verbatim>
+
+ <a4j:outputPanel layout="block">
+
+
+ <a4j:outputPanel layout="block">
+ <h:form>
+ <h:message for="text1" style="color:red" />
+
+ <h:outputText style="font-weight: bold;"
value="Enter Text: "/>
+ <h:inputText id="text1" label="text1"
value="#{opBean1.text}">
+ <f:validateLength maximum="10"/>
+ <a4j:ajax event="keyup"
execute="@this" render="out1" onerror="function(){return
false}"/>
+ </h:inputText>
+
+ <h:outputText id="out1" rendered="#{not empty
opBean1.text}" value="Approved Text: #{opBean1.text}" />
+ </h:form>
+ </a4j:outputPanel>
+
+ </a4j:outputPanel>
+
+ <a4j:outputPanel layout="block">
+ <h:form>
+ <a4j:outputPanel ajaxRendered="true"
layout="block">
+ <h:message for="text2" style="color:red"
/>
+ </a4j:outputPanel>
+
+ <h:outputText style="font-weight: bold;"
value="Enter Text: "/>
+ <h:inputText id="text2" label="text2"
value="#{opBean2.text}">
+ <f:validateLength maximum="10"/>
+ <a4j:ajax event="keyup"
execute="@this" render="out2" />
+ </h:inputText>
+
+ <a4j:outputPanel id="out2" layout="block">
+ <h:outputText rendered="#{not empty opBean2.text}"
value="Approved Text: #{opBean2.text}" />
+ </a4j:outputPanel>
+ </h:form>
+ </a4j:outputPanel>
+ </h:panelGrid>
</ui:composition>
</html>
\ No newline at end of file
Modified: root/examples/trunk/richfaces-demo/src/main/webapp/richfaces/outputPanel.xhtml
===================================================================
---
root/examples/trunk/richfaces-demo/src/main/webapp/richfaces/outputPanel.xhtml 2009-08-27
15:06:55 UTC (rev 15346)
+++
root/examples/trunk/richfaces-demo/src/main/webapp/richfaces/outputPanel.xhtml 2009-08-27
15:07:55 UTC (rev 15347)
@@ -21,15 +21,18 @@
<li></li>
</ul>
</p>
+ <fieldset>
+ <legend>Sample</legend>
+ <ui:include src="/richfaces/outputPanel/usage.xhtml" />
+ </fieldset>
<p>
- In the sample you could see how <b>h:message components inserted
dynamically</b> if exist.
- Also user record <b>storing status updated automatically</b> after request
without mentioning
- in <b>render</b> property.
-
+ Next sample shows how you could simply create composite component from
+ standard h:messages and a4j:outputPanel in order to get them updated
+ for any ajax request without render definition.
</p>
<fieldset>
<legend>Sample</legend>
- <ui:include src="/richfaces/outputPanel/usage.xhtml" />
+ <ui:include src="/richfaces/outputPanel/compositemessages.xhtml" />
</fieldset>
</ui:define>
</ui:composition>
Modified: root/examples/trunk/richfaces-demo/src/main/webapp/richfaces/push/usage.xhtml
===================================================================
---
root/examples/trunk/richfaces-demo/src/main/webapp/richfaces/push/usage.xhtml 2009-08-27
15:06:55 UTC (rev 15346)
+++
root/examples/trunk/richfaces-demo/src/main/webapp/richfaces/push/usage.xhtml 2009-08-27
15:07:55 UTC (rev 15347)
@@ -38,9 +38,9 @@
rendered="#{choicesBean.enabled}" />
</a4j:outputPanel>
- <a4j:push enabled="#{choicesBean.enabled}" interval="3000"
+ <a4j:push enabled="#{choicesBean.enabled}" interval="1000"
eventProducer="#{choicesBean.addListener}" id="push"
action="#{choicesBean.processUpdates}">
- <f:ajax render="choiceVotes push tempResults" />
+ <a4j:ajax render="choiceVotes push tempResults" />
</a4j:push>
</h:form>
</ui:composition>
Modified: root/examples/trunk/richfaces-demo/src/main/webapp/richfaces/push.xhtml
===================================================================
--- root/examples/trunk/richfaces-demo/src/main/webapp/richfaces/push.xhtml 2009-08-27
15:06:55 UTC (rev 15346)
+++ root/examples/trunk/richfaces-demo/src/main/webapp/richfaces/push.xhtml 2009-08-27
15:07:55 UTC (rev 15347)
@@ -6,8 +6,17 @@
<ui:composition template="/templates/main.xhtml">
<ui:define name="body">
- <p>push description</p>
- <fieldset>
+ <p>The <b><a4j:push></b> periodically perform AJAX
request to
+ server, to simulate 'push' data.</p>
+ <p><b><a4j:push></b> makes request to
+ minimal code only (not to JSF tree) in order to check the presence of
+ messages in the queue. If the message exists the complete request will
+ be performed. The component doesn't poll registered beans but
+ registers EventListener which receives messages about events.</p>
+ <p>Attribute '<b>interval</b>' is used as for poll component.
It
+ specifies the interval in ms. for call push request. Simple example of
+ usage:</p>
+ <fieldset>
<legend>
Push Sample
</legend>
Added:
root/examples/trunk/richfaces-demo/src/main/webapp/richfaces/status/referencedusage.xhtml
===================================================================
---
root/examples/trunk/richfaces-demo/src/main/webapp/richfaces/status/referencedusage.xhtml
(rev 0)
+++
root/examples/trunk/richfaces-demo/src/main/webapp/richfaces/status/referencedusage.xhtml 2009-08-27
15:07:55 UTC (rev 15347)
@@ -0,0 +1,37 @@
+<!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:h="http://java.sun.com/jsf/html"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:a4j="http://richfaces.org/a4j"
+
xmlns:rich="http://java.sun.com/jsf/composite/rich">
+<ui:composition>
+ <h:panelGrid columns="3" width="300px;">
+ <rich:panel>
+ <f:facet name="header">
+ <h:outputText value="User Details Panel" />
+ </f:facet>
+ <h:panelGrid columns="3">
+ <h:outputText value="User name:" />
+ <h:inputText value="#{userBean.name}" >
+ <a4j:ajax statusId="nameStatus" event="keyup"/>
+ </h:inputText>
+ <a4j:status name="nameStatus">
+ <f:facet name="start">
+ <h:graphicImage value="/images/ai.gif"/>
+ </f:facet>
+ </a4j:status>
+ <h:outputText value="Adress:" />
+ <h:inputText value="#{userBean.address}">
+ <a4j:ajax statusId="adressStatus" event="keyup"/>
+ </h:inputText>
+ <a4j:status name="adressStatus">
+ <f:facet name="start">
+ <h:graphicImage value="/images/ai.gif"/>
+ </f:facet>
+ </a4j:status>
+ </h:panelGrid>
+ </rich:panel>
+ </h:panelGrid>
+</ui:composition>
+</html>
\ No newline at end of file
Modified: root/examples/trunk/richfaces-demo/src/main/webapp/richfaces/status.xhtml
===================================================================
--- root/examples/trunk/richfaces-demo/src/main/webapp/richfaces/status.xhtml 2009-08-27
15:06:55 UTC (rev 15346)
+++ root/examples/trunk/richfaces-demo/src/main/webapp/richfaces/status.xhtml 2009-08-27
15:07:55 UTC (rev 15347)
@@ -6,22 +6,38 @@
<ui:composition template="/templates/main.xhtml">
<ui:define name="body">
+ <p>a4j:status is an indicator of an Ajax request. It has two states - start and
stop. The start
+ state indicates that an Ajax request is in progress. When Ajax Response comes back,
+ the component switches to the stop stage.
+ </p>
+ <p> Status could be defined:
+ <ul>
+ <li>Default for View</li>
+ <li>Default for form</li>
+ <li>Referenced explicity from the component which sends request</li>
+ </ul>
+ </p>
<p>
- Description for Status goes there.
+ Example of View scoped status
</p>
<fieldset>
+ <legend>Default view status sample</legend>
+ <ui:include src="/richfaces/status/viewusage.xhtml" />
+ </fieldset>
+ <p>
+ Example of form scoped status
+ </p>
+ <fieldset>
<legend>Default form status sample</legend>
<ui:include src="/richfaces/status/usage.xhtml" />
</fieldset>
+ <p>
+ Example of status which referenced from the components
+ </p>
<fieldset>
- <legend>Default view status sample</legend>
- <ui:include src="/richfaces/status/viewusage.xhtml" />
- </fieldset>
- <fieldset>
<legend>Referenced status sample</legend>
<ui:include src="/richfaces/status/referencedusage.xhtml" />
</fieldset>
</ui:define>
</ui:composition>
-
</html>
\ No newline at end of file
Modified:
root/examples/trunk/richfaces-demo/src/main/webapp/templates/includes/navigation.xhtml
===================================================================
---
root/examples/trunk/richfaces-demo/src/main/webapp/templates/includes/navigation.xhtml 2009-08-27
15:06:55 UTC (rev 15346)
+++
root/examples/trunk/richfaces-demo/src/main/webapp/templates/includes/navigation.xhtml 2009-08-27
15:07:55 UTC (rev 15347)
@@ -10,6 +10,8 @@
</f:facet>
<h:panelGrid columns="1">
<h:outputLink
+ value="#{facesContext.externalContext.requestContextPath}/richfaces/ajax.jsf">a4j:ajax</h:outputLink>
+ <h:outputLink
value="#{facesContext.externalContext.requestContextPath}/richfaces/jsFunction.jsf">a4j:jsFunction</h:outputLink>
<h:outputLink
value="#{facesContext.externalContext.requestContextPath}/richfaces/mediaOutput.jsf">a4j:mediaOutput</h:outputLink>