[richfaces-svn-commits] JBoss Rich Faces SVN: r18393 - in root/tests/metamer/trunk/application/src/main: webapp/components and 1 other directories.

richfaces-svn-commits at lists.jboss.org richfaces-svn-commits at lists.jboss.org
Tue Aug 3 08:02:38 EDT 2010


Author: ppitonak at redhat.com
Date: 2010-08-03 08:02:37 -0400 (Tue, 03 Aug 2010)
New Revision: 18393

Added:
   root/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JAttachQueueBean.java
   root/tests/metamer/trunk/application/src/main/webapp/components/a4jAttachQueue/
   root/tests/metamer/trunk/application/src/main/webapp/components/a4jAttachQueue/list.xhtml
   root/tests/metamer/trunk/application/src/main/webapp/components/a4jAttachQueue/simple.xhtml
   root/tests/metamer/trunk/application/src/main/webapp/components/a4jAttachQueue/wrapped.xhtml
Modified:
   root/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JQueueBean.java
   root/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichBean.java
Log:
RFPL-734

* a4j:attachQueue added
* unnecessary logging removed from A4JQueueBean



Added: root/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JAttachQueueBean.java
===================================================================
--- root/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JAttachQueueBean.java	                        (rev 0)
+++ root/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JAttachQueueBean.java	2010-08-03 12:02:37 UTC (rev 18393)
@@ -0,0 +1,102 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ *******************************************************************************/
+package org.richfaces.tests.metamer.bean;
+
+import java.io.Serializable;
+
+import javax.annotation.PostConstruct;
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.ViewScoped;
+import org.richfaces.component.UIAttachQueue;
+
+import org.richfaces.tests.metamer.Attributes;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Managed bean for a4j:attachQueue.
+ *
+ * @author <a href="mailto:ppitonak at redhat.com">Pavol Pitonak</a>
+ * @version $Revision$
+ */
+ at ManagedBean(name = "a4jAttachQueueBean")
+ at ViewScoped
+public class A4JAttachQueueBean implements Serializable {
+
+    private static final long serialVersionUID = -1L;
+    private static Logger logger;
+    private Attributes attributes;
+    private Attributes attributes2;
+    private String text1;
+    private String text2;
+
+    /**
+     * Initializes the managed bean.
+     */
+    @PostConstruct
+    public void init() {
+        logger = LoggerFactory.getLogger(getClass());
+        logger.info("initializing bean " + getClass().getName());
+
+        // initialize attributes
+        attributes = Attributes.getUIComponentAttributes(UIAttachQueue.class, getClass());
+        attributes.setAttribute("rendered", true);
+        attributes.setAttribute("requestDelay", 1500);
+
+        attributes2 = Attributes.getUIComponentAttributes(UIAttachQueue.class, getClass());
+        attributes2.setAttribute("rendered", true);
+        attributes2.setAttribute("requestDelay", 1500);
+
+    }
+
+    public Attributes getAttributes() {
+        return attributes;
+    }
+
+    public void setAttributes(Attributes attributes) {
+        this.attributes = attributes;
+    }
+
+    public Attributes getAttributes2() {
+        return attributes2;
+    }
+
+    public void setAttributes2(Attributes attributes2) {
+        this.attributes2 = attributes2;
+    }
+
+    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;
+    }
+}


Property changes on: root/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JAttachQueueBean.java
___________________________________________________________________
Name: svn:keywords
   + Revision

Modified: root/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JQueueBean.java
===================================================================
--- root/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JQueueBean.java	2010-08-03 09:43:58 UTC (rev 18392)
+++ root/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JQueueBean.java	2010-08-03 12:02:37 UTC (rev 18393)
@@ -75,7 +75,6 @@
     }
 
     public void setText(String text) {
-        logger.error("setText " + text);
         this.text = text;
     }
 }

Modified: root/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichBean.java
===================================================================
--- root/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichBean.java	2010-08-03 09:43:58 UTC (rev 18392)
+++ root/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichBean.java	2010-08-03 12:02:37 UTC (rev 18393)
@@ -92,6 +92,7 @@
 
         components.put("a4jActionListener", "A4J Action Listener");
         components.put("a4jAjax", "A4J Ajax");
+        components.put("a4jAttachQueue", "A4J Attach Queue");
         components.put("a4jCommandLink", "A4J Command Link");
         components.put("a4jCommandButton", "A4J Command Button");
         components.put("a4jJSFunction", "A4J JavaScript Function");

Added: root/tests/metamer/trunk/application/src/main/webapp/components/a4jAttachQueue/list.xhtml
===================================================================
--- root/tests/metamer/trunk/application/src/main/webapp/components/a4jAttachQueue/list.xhtml	                        (rev 0)
+++ root/tests/metamer/trunk/application/src/main/webapp/components/a4jAttachQueue/list.xhtml	2010-08-03 12:02:37 UTC (rev 18393)
@@ -0,0 +1,45 @@
+<!--
+JBoss, Home of Professional Open Source
+Copyright 2010, Red Hat, Inc. and individual contributors
+by the @authors tag. See the copyright.txt in the distribution for a
+full listing of individual contributors.
+
+This is free software; you can redistribute it and/or modify it
+under the terms of the GNU Lesser General Public License as
+published by the Free Software Foundation; either version 2.1 of
+the License, or (at your option) any later version.
+
+This software is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this software; if not, write to the Free
+Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+02110-1301 USA, or see the FSF site: http://www.fsf.org.
+-->
+
+<!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:ta="http://java.sun.com/jsf/composite/testapp">
+
+    <ui:composition template="/templates/list.xhtml">
+
+        <ui:define name="pageTitle">A4J Attach Queue</ui:define>
+
+        <ui:define name="links">
+
+            <ta:testPageLink id="simple" outcome="simple" value="Simple">
+                Page containing <b>a4j:attachQueue</b>, two inputs and input boxes for all its attributes.
+            </ta:testPageLink>
+
+            <ta:testPageLink id="wrapped" outcome="wrapped" value="Wrapped">
+                Page containing <b>a4j:attachQueue</b>, a4j:ajax wrapping two inputs and input boxes for all its attributes.
+            </ta:testPageLink>
+
+        </ui:define>
+
+    </ui:composition>
+
+</html>

Added: root/tests/metamer/trunk/application/src/main/webapp/components/a4jAttachQueue/simple.xhtml
===================================================================
--- root/tests/metamer/trunk/application/src/main/webapp/components/a4jAttachQueue/simple.xhtml	                        (rev 0)
+++ root/tests/metamer/trunk/application/src/main/webapp/components/a4jAttachQueue/simple.xhtml	2010-08-03 12:02:37 UTC (rev 18393)
@@ -0,0 +1,125 @@
+<!--
+JBoss, Home of Professional Open Source
+Copyright 2010, Red Hat, Inc. and individual contributors
+by the @authors tag. See the copyright.txt in the distribution for a
+full listing of individual contributors.
+
+This is free software; you can redistribute it and/or modify it
+under the terms of the GNU Lesser General Public License as
+published by the Free Software Foundation; either version 2.1 of
+the License, or (at your option) any later version.
+
+This software is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this software; if not, write to the Free
+Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+02110-1301 USA, or see the FSF site: http://www.fsf.org.
+-->
+
+<!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:ta="http://java.sun.com/jsf/composite/testapp" xmlns:rich="http://richfaces.org/rich">
+
+    <ui:composition template="/templates/template.xhtml">
+
+        <ui:define name="head">
+            <f:metadata>
+                <f:viewParam name="templates" value="#{templateBean.templates}">
+                    <f:converter converterId="templatesListConverter" />
+                </f:viewParam>
+            </f:metadata>
+
+            <script type="text/javascript">
+                var events = 0;
+                var updates = 0;
+                var requests = 0;
+
+                function addEvent() {
+                    events++;
+                }
+                function addUpdate() {
+                    updates++;
+                }
+                function addRequest() {
+                    requests++;
+                }
+
+                function printCounts() {
+                #{rich:element('events')}.innerHTML=events;
+                #{rich:element('updates')}.innerHTML=updates;
+                #{rich:element('requests')}.innerHTML=requests;
+                }
+            </script>
+        </ui:define>
+
+        <ui:define name="outOfTemplateBefore">
+        </ui:define>
+
+        <ui:define name="component">
+            <a4j:queue id="queue1"/>
+            <a4j:queue id="queue2"/>
+
+            <h:inputText id="input1" value="#{a4jAttachQueueBean.text1}" onkeyup="addEvent();">
+                <a4j:ajax event="keyup" render="output1" execute="@form" onbegin="addRequest();"
+                          oncomplete="printCounts()" onbeforedomupdate="addUpdate()">
+                    <a4j:attachQueue id="a4jAttachQueue1"
+                                     ignoreDupResponses="#{a4jAttachQueueBean.attributes['ignoreDupResponses'].value}"
+                                     name="#{a4jAttachQueueBean.attributes['name'].value}"
+                                     onrequestdequeue="#{a4jAttachQueueBean.attributes['onrequestdequeue'].value}"
+                                     onrequestqueue="#{a4jAttachQueueBean.attributes['onrequestqueue'].value}"
+                                     queueId="#{a4jAttachQueueBean.attributes['queueId'].value}"
+                                     rendered="#{a4jAttachQueueBean.attributes['rendered'].value}"
+                                     requestDelay="#{a4jAttachQueueBean.attributes['requestDelay'].value}"
+                                     requestGroupingId="#{a4jAttachQueueBean.attributes['requestGroupingId'].value}"
+                                     timeout="#{a4jAttachQueueBean.attributes['timeout'].value}"/>
+                </a4j:ajax>
+            </h:inputText>
+
+            <h:inputText id="input2" value="#{a4jAttachQueueBean.text2}" onkeyup="addEvent();">
+                <a4j:ajax event="keyup" render="output1" execute="@form" onbegin="addRequest();"
+                          oncomplete="printCounts()" onbeforedomupdate="addUpdate()">
+                    <a4j:attachQueue id="a4jAttachQueue2"
+                                     ignoreDupResponses="#{a4jAttachQueueBean.attributes2['ignoreDupResponses'].value}"
+                                     name="#{a4jAttachQueueBean.attributes2['name'].value}"
+                                     onrequestdequeue="#{a4jAttachQueueBean.attributes2['onrequestdequeue'].value}"
+                                     onrequestqueue="#{a4jAttachQueueBean.attributes2['onrequestqueue'].value}"
+                                     queueId="#{a4jAttachQueueBean.attributes2['queueId'].value}"
+                                     rendered="#{a4jAttachQueueBean.attributes2['rendered'].value}"
+                                     requestDelay="#{a4jAttachQueueBean.attributes2['requestDelay'].value}"
+                                     requestGroupingId="#{a4jAttachQueueBean.attributes2['requestGroupingId'].value}"
+                                     timeout="#{a4jAttachQueueBean.attributes2['timeout'].value}"/>
+                </a4j:ajax>
+            </h:inputText>
+
+            <h:panelGrid columns="2">
+                Output 1:
+                <h:outputText id="output1" value="#{a4jAttachQueueBean.text1}" style="font-weight:bold;"/>
+                Output 2:
+                <h:outputText id="output2" value="#{a4jAttachQueueBean.text2}" style="font-weight:bold;"/>
+                Events count:
+                <h:outputText value="0" id="events" />
+                Requests count:
+                <h:outputText value="0" id="requests" />
+                DOM updates count:
+                <h:outputText value="0" id="updates" />
+            </h:panelGrid>
+
+        </ui:define>
+
+        <ui:define name="outOfTemplateAfter">
+            Attributes for first attach queue (first input)
+            <br/>
+            <ta:attributes value="#{a4jAttachQueueBean.attributes}" id="attributes" />
+            <br/>
+            Attributes for second attach queue (second input)
+            <br/>
+            <ta:attributes value="#{a4jAttachQueueBean.attributes2}" id="attributes2" />
+        </ui:define>
+
+    </ui:composition>
+</html>
\ No newline at end of file

Added: root/tests/metamer/trunk/application/src/main/webapp/components/a4jAttachQueue/wrapped.xhtml
===================================================================
--- root/tests/metamer/trunk/application/src/main/webapp/components/a4jAttachQueue/wrapped.xhtml	                        (rev 0)
+++ root/tests/metamer/trunk/application/src/main/webapp/components/a4jAttachQueue/wrapped.xhtml	2010-08-03 12:02:37 UTC (rev 18393)
@@ -0,0 +1,104 @@
+<!--
+JBoss, Home of Professional Open Source
+Copyright 2010, Red Hat, Inc. and individual contributors
+by the @authors tag. See the copyright.txt in the distribution for a
+full listing of individual contributors.
+
+This is free software; you can redistribute it and/or modify it
+under the terms of the GNU Lesser General Public License as
+published by the Free Software Foundation; either version 2.1 of
+the License, or (at your option) any later version.
+
+This software is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this software; if not, write to the Free
+Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+02110-1301 USA, or see the FSF site: http://www.fsf.org.
+-->
+
+<!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:ta="http://java.sun.com/jsf/composite/testapp" xmlns:rich="http://richfaces.org/rich">
+
+    <ui:composition template="/templates/template.xhtml">
+
+        <ui:define name="head">
+            <f:metadata>
+                <f:viewParam name="templates" value="#{templateBean.templates}">
+                    <f:converter converterId="templatesListConverter" />
+                </f:viewParam>
+            </f:metadata>
+
+            <script type="text/javascript">
+                var events = 0;
+                var updates = 0;
+                var requests = 0;
+
+                function addEvent() {
+                    events++;
+                }
+                function addUpdate() {
+                    updates++;
+                }
+                function addRequest() {
+                    requests++;
+                }
+
+                function printCounts() {
+                #{rich:element('events')}.innerHTML=events;
+                #{rich:element('updates')}.innerHTML=updates;
+                #{rich:element('requests')}.innerHTML=requests;
+                }
+            </script>
+        </ui:define>
+
+        <ui:define name="outOfTemplateBefore">
+        </ui:define>
+
+        <ui:define name="component">
+            <a4j:queue id="queue1"/>
+            <a4j:queue id="queue2"/>
+
+            <a4j:ajax event="keyup" render="output1, output2" execute="@form" onbegin="addRequest();"
+                      oncomplete="printCounts()" onbeforedomupdate="addUpdate()">
+                <a4j:attachQueue id="a4jAttachQueue"
+                                 ignoreDupResponses="#{a4jAttachQueueBean.attributes1['ignoreDupResponses'].value}"
+                                 name="#{a4jAttachQueueBean.attributes1['name'].value}"
+                                 onrequestdequeue="#{a4jAttachQueueBean.attributes1['onrequestdequeue'].value}"
+                                 onrequestqueue="#{a4jAttachQueueBean.attributes1['onrequestqueue'].value}"
+                                 queueId="#{a4jAttachQueueBean.attributes1['queueId'].value}"
+                                 rendered="#{a4jAttachQueueBean.attributes1['rendered'].value}"
+                                 requestDelay="#{a4jAttachQueueBean.attributes1['requestDelay'].value}"
+                                 requestGroupingId="#{a4jAttachQueueBean.attributes1['requestGroupingId'].value}"
+                                 timeout="#{a4jAttachQueueBean.attributes1['timeout'].value}"/>
+
+                <h:inputText id="input1" value="#{a4jAttachQueueBean.text1}" onkeyup="addEvent();"/>
+                <h:inputText id="input2" value="#{a4jAttachQueueBean.text2}" onkeyup="addEvent();"/>
+            </a4j:ajax>
+
+            <h:panelGrid columns="2">
+                Output 1:
+                <h:outputText id="output1" value="#{a4jAttachQueueBean.text1}" style="font-weight:bold;"/>
+                Output 2:
+                <h:outputText id="output2" value="#{a4jAttachQueueBean.text2}" style="font-weight:bold;"/>
+                Events count:
+                <h:outputText value="0" id="events" />
+                Requests count:
+                <h:outputText value="0" id="requests" />
+                DOM updates count:
+                <h:outputText value="0" id="updates" />
+            </h:panelGrid>
+
+        </ui:define>
+
+        <ui:define name="outOfTemplateAfter">
+            <ta:attributes value="#{a4jAttachQueueBean.attributes1}" id="attributes" />
+        </ui:define>
+
+    </ui:composition>
+</html>
\ No newline at end of file



More information about the richfaces-svn-commits mailing list