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

richfaces-svn-commits at lists.jboss.org richfaces-svn-commits at lists.jboss.org
Tue Aug 3 05:43:58 EDT 2010


Author: ppitonak at redhat.com
Date: 2010-08-03 05:43:58 -0400 (Tue, 03 Aug 2010)
New Revision: 18392

Added:
   root/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JQueueBean.java
   root/tests/metamer/trunk/application/src/main/webapp/components/a4jQueue/
   root/tests/metamer/trunk/application/src/main/webapp/components/a4jQueue/list.xhtml
   root/tests/metamer/trunk/application/src/main/webapp/components/a4jQueue/simple.xhtml
   root/tests/metamer/trunk/application/src/main/webapp/resources/css/a4jQueue.css
Modified:
   root/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichBean.java
Log:
RFPL-733

* added a4j:queue



Added: 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	                        (rev 0)
+++ root/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JQueueBean.java	2010-08-03 09:43:58 UTC (rev 18392)
@@ -0,0 +1,81 @@
+/*******************************************************************************
+ * 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.UIQueue;
+
+import org.richfaces.tests.metamer.Attributes;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Managed bean for a4j:queue.
+ *
+ * @author <a href="mailto:ppitonak at redhat.com">Pavol Pitonak</a>
+ * @version $Revision$
+ */
+ at ManagedBean(name = "a4jQueueBean")
+ at ViewScoped
+public class A4JQueueBean implements Serializable {
+
+    private static final long serialVersionUID = 486866943531809L;
+    private static Logger logger;
+    private Attributes attributes;
+    private String text;
+
+    /**
+     * Initializes the managed bean.
+     */
+    @PostConstruct
+    public void init() {
+        logger = LoggerFactory.getLogger(getClass());
+        logger.debug("initializing bean " + getClass().getName());
+
+        // initialize attributes
+        attributes = Attributes.getUIComponentAttributes(UIQueue.class, getClass());
+        attributes.setAttribute("rendered", true);
+        attributes.setAttribute("requestDelay", 1500);
+
+    }
+
+    public Attributes getAttributes() {
+        return attributes;
+    }
+
+    public void setAttributes(Attributes attributes) {
+        this.attributes = attributes;
+    }
+
+    public String getText() {
+        return text;
+    }
+
+    public void setText(String text) {
+        logger.error("setText " + text);
+        this.text = text;
+    }
+}


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

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 08:49:05 UTC (rev 18391)
+++ root/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichBean.java	2010-08-03 09:43:58 UTC (rev 18392)
@@ -101,6 +101,7 @@
         components.put("a4jParam", "A4J Action Parameter");
         components.put("a4jPoll", "A4J Poll");
         components.put("a4jPush", "A4J Push");
+        components.put("a4jQueue", "A4J Queue");
         components.put("a4jRegion", "A4J Region");
         components.put("a4jRepeat", "A4J Repeat");
         components.put("commandButton", "JSF Command Button");

Added: root/tests/metamer/trunk/application/src/main/webapp/components/a4jQueue/list.xhtml
===================================================================
--- root/tests/metamer/trunk/application/src/main/webapp/components/a4jQueue/list.xhtml	                        (rev 0)
+++ root/tests/metamer/trunk/application/src/main/webapp/components/a4jQueue/list.xhtml	2010-08-03 09:43:58 UTC (rev 18392)
@@ -0,0 +1,41 @@
+<!--
+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 Queue</ui:define>
+
+        <ui:define name="links">
+
+            <ta:testPageLink id="simple" outcome="simple" value="Simple">
+                Simple page that contains <b>a4j:queue</b> and input boxes for all its attributes.
+            </ta:testPageLink>
+
+        </ui:define>
+
+    </ui:composition>
+
+</html>

Added: root/tests/metamer/trunk/application/src/main/webapp/components/a4jQueue/simple.xhtml
===================================================================
--- root/tests/metamer/trunk/application/src/main/webapp/components/a4jQueue/simple.xhtml	                        (rev 0)
+++ root/tests/metamer/trunk/application/src/main/webapp/components/a4jQueue/simple.xhtml	2010-08-03 09:43:58 UTC (rev 18392)
@@ -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>
+            <h:outputStylesheet library="css" name="a4jQueue.css" />
+            <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="a4jQueue" 
+                       ignoreDupResponses="#{a4jQueueBean.attributes['ignoreDupResponses'].value}"
+                       name="#{a4jQueueBean.attributes['name'].value}"
+                       onbeforedomupdate="#{a4jQueueBean.attributes['onbeforedomupdate'].value}"
+                       oncomplete="#{a4jQueueBean.attributes['oncomplete'].value}"
+                       onerror="#{a4jQueueBean.attributes['onerror'].value}"
+                       onevent="#{a4jQueueBean.attributes['event'].value}"
+                       onrequestdequeue="#{a4jQueueBean.attributes['onrequestdequeue'].value}"
+                       onrequestqueue="#{a4jQueueBean.attributes['onrequestqueue'].value}"
+                       onsubmit="#{a4jQueueBean.attributes['onsubmit'].value}"
+                       rendered="#{a4jQueueBean.attributes['rendered'].value}"
+                       requestDelay="#{a4jQueueBean.attributes['requestDelay'].value}"
+                       status="#{a4jQueueBean.attributes['status'].value}"
+                       timeout="#{a4jQueueBean.attributes['timeout'].value}"/>
+
+            <h:panelGrid columns="2">
+                <h:outputText value="Type here:" />
+                <h:inputText id="input" value="#{a4jQueueBean.text}" onkeyup="addEvent();" disabled="#{not (facesContext.maximumSeverity==null)}">
+                    <a4j:ajax onbegin="addRequest();"  event="keyup" render="outtext" oncomplete="printCounts()" onbeforedomupdate="addUpdate()" />
+                </h:inputText>
+
+                <h:outputText value="Repeated text:" />
+                <h:outputText value="#{a4jQueueBean.text}" id="outtext"
+                              style="font-weight:bold;" />
+                <h:outputText value="Events count:" />
+                <h:outputText value="0" id="events" />
+                <h:outputText value="Requests count:" />
+                <h:outputText value="0" id="requests" />
+                <h:outputText value="DOM updates count:" />
+                <h:outputText value="0" id="updates" />
+            </h:panelGrid>
+
+        </ui:define>
+
+        <ui:define name="outOfTemplateAfter">
+            <ta:attributes value="#{a4jQueueBean.attributes}" id="attributes" />
+        </ui:define>
+
+    </ui:composition>
+</html>
\ No newline at end of file

Added: root/tests/metamer/trunk/application/src/main/webapp/resources/css/a4jQueue.css
===================================================================



More information about the richfaces-svn-commits mailing list