Author: abelevich
Date: 2009-08-27 07:30:06 -0400 (Thu, 27 Aug 2009)
New Revision: 15338
Added:
root/examples/trunk/components/core-demo/src/main/java/org/richfaces/demo/SupportBean.java
root/examples/trunk/components/core-demo/src/main/webapp/support.xhtml
Removed:
root/examples/trunk/components/core-demo/src/main/webapp/pages/
Log:
developers sample a4j:ajax
Added:
root/examples/trunk/components/core-demo/src/main/java/org/richfaces/demo/SupportBean.java
===================================================================
---
root/examples/trunk/components/core-demo/src/main/java/org/richfaces/demo/SupportBean.java
(rev 0)
+++
root/examples/trunk/components/core-demo/src/main/java/org/richfaces/demo/SupportBean.java 2009-08-27
11:30:06 UTC (rev 15338)
@@ -0,0 +1,36 @@
+package org.richfaces.demo;
+
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.SessionScoped;
+import javax.faces.event.AjaxBehaviorEvent;
+import javax.faces.event.BehaviorEvent;
+
+@SessionScoped
+@ManagedBean(name="supportBean")
+public class SupportBean {
+
+ private String text1;
+
+ private String text2;
+
+ public String getText1() {
+ return text1;
+ }
+
+ public void setText1(String text1) {
+ this.text1 = text1;
+ }
+
+ public String getText2() {
+ return text2;
+ }
+
+ public void setText2(String text2) {
+ this.text2 = text2;
+ }
+
+ public void behaviorListener(AjaxBehaviorEvent event) {
+ System.out.println("SupportBean.behaviorListener()");
+ }
+
+}
Added: root/examples/trunk/components/core-demo/src/main/webapp/support.xhtml
===================================================================
--- root/examples/trunk/components/core-demo/src/main/webapp/support.xhtml
(rev 0)
+++ root/examples/trunk/components/core-demo/src/main/webapp/support.xhtml 2009-08-27
11:30:06 UTC (rev 15338)
@@ -0,0 +1,66 @@
+<!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:f="http://java.sun.com/jsf/core"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:a="http://richfaces.org/a4j">
+ <h:head>
+ Richfaces Ajax Sample
+
+ </h:head>
+ <h:body>
+ <script type="text/javascript">
+ function selectEventSource(source, borderStyle) {
+ jQuery(source).css('border', borderStyle);
+ }
+ </script>
+
+ <h:form>
+ <a:status name="ilStatus" startText="...start..."
stopText="...stop..." />
+ <h:panelGrid columns="2">
+ <h:outputText value="a:ajax attached fires ajax submit on 'keyup'
event"/>
+ <h:inputText value="#{supportBean.text1}">
+ <a:ajax event="keyup" render="text1"
statusId="ilStatus" listener="#{supportBean.behaviorListener}"/>
+ </h:inputText>
+ </h:panelGrid>
+
+
+
+ <h:panelGrid columns="2" style="border: 1px solid green;">
+ <h:outputText value="reRender text1: "/>
+ <h:outputText id="text1" value="#{supportBean.text1}" />
+
+ <h:outputText value="Ajax Panel ajaxRendered='true':"/>
+ <a:outputPanel ajaxRendered="true" style="border: 1px solid
red;">
+ <f:facet name="header">test</f:facet>
+ <h:outputText value="Ajax Panel ajaxRendered='true':" />
+ <h:panelGroup style="padding: 2px;">
+ <h:outputText value="#{supportBean.text1}"/>
+ </h:panelGroup>
+ </a:outputPanel>
+ </h:panelGrid>
+
+ <h:panelGrid columns="2">
+ <h:outputText value="a:ajax attached fires ajax submit on default
event"/>
+ <h:inputText value="#{supportBean.text2}">
+ <a:ajax render="text2" statusId="ilStatus"
limitRender="true"/>
+ </h:inputText>
+ </h:panelGrid>
+
+ <h:panelGrid columns="2" style="border: 1px solid green;">
+ <h:outputText value="reRender text2 limitRender='true': "/>
+ <h:outputText id="text2" value="#{supportBean.text2}" />
+
+ <h:outputText value="Ajax Panel shouldn't work coz < a:ajax
limitRender='true' /> :"/>
+ <a:outputPanel ajaxRendered="true" style="border: 1px solid
red;">
+ <h:outputText value="Ajax Panel ajaxRendered='true':" />
+ <h:panelGroup style="padding: 2px;">
+ <h:outputText value="#{supportBean.text2}"/>
+ </h:panelGroup>
+ </a:outputPanel>
+ </h:panelGrid>
+
+
+ </h:form>
+ </h:body>
+</html>
\ No newline at end of file