Author: lfryc(a)redhat.com
Date: 2011-02-05 09:50:50 -0500 (Sat, 05 Feb 2011)
New Revision: 21481
Added:
modules/tests/metamer/trunk/application/src/main/webapp/components/a4jAttachQueue/namedQueue.xhtml
Modified:
modules/tests/metamer/trunk/application/src/main/webapp/components/a4jAttachQueue/list.xhtml
Log:
a4j:attachQueue - added namedQueue sample (RFPL-733, RF-10364))
Modified:
modules/tests/metamer/trunk/application/src/main/webapp/components/a4jAttachQueue/list.xhtml
===================================================================
---
modules/tests/metamer/trunk/application/src/main/webapp/components/a4jAttachQueue/list.xhtml 2011-02-05
14:50:20 UTC (rev 21480)
+++
modules/tests/metamer/trunk/application/src/main/webapp/components/a4jAttachQueue/list.xhtml 2011-02-05
14:50:50 UTC (rev 21481)
@@ -48,6 +48,10 @@
<div>First a4j:ajax controls clicks to h:inputText and
a4j:commandButton.</div>
<div>Second a4j:ajax controls valueChanges of
h:inputText.</div>
</metamer:testPageLink>
+
+ <metamer:testPageLink id="namedQueue"
outcome="namedQueue" value="Named Queue">
+ Special sample for testing referencing queue from attachQueue by name
(attachQueue in this simple can contain requestDelay).
+ </metamer:testPageLink>
</ui:define>
Added:
modules/tests/metamer/trunk/application/src/main/webapp/components/a4jAttachQueue/namedQueue.xhtml
===================================================================
---
modules/tests/metamer/trunk/application/src/main/webapp/components/a4jAttachQueue/namedQueue.xhtml
(rev 0)
+++
modules/tests/metamer/trunk/application/src/main/webapp/components/a4jAttachQueue/namedQueue.xhtml 2011-02-05
14:50:50 UTC (rev 21481)
@@ -0,0 +1,132 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!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:metamer="http://java.sun.com/jsf/composite/metamer"
xmlns:rich="http://richfaces.org/rich"
+
xmlns:c="http://java.sun.com/jsp/jstl/core">
+
+ <!--
+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.
+ -->
+
+ <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">
+ function add(element) {
+ element.innerHTML = 1 + parseInt(element.innerHTML);
+ }
+ </script>
+ </ui:define>
+
+ <ui:define name="outOfTemplateBefore">
+ </ui:define>
+
+ <ui:define name="component">
+ <a4j:queue id="queue1"
+ name="namedQueue"
+
onbeforedomupdate="#{a4jQueueBean.attributes['onbeforedomupdate'].value}"
+
oncomplete="#{a4jQueueBean.attributes['oncomplete'].value}"
+
onerror="#{a4jQueueBean.attributes['onerror'].value}"
+
onevent="#{a4jQueueBean.attributes['onevent'].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:inputText id="input1"
value="#{a4jAttachQueueBean.text1}"
onkeypress="add(#{rich:element('events1')});
#{rich:element('timeWatcher:grid')}.event(1); ">
+ <a4j:ajax event="keypress" render="output1"
execute="@form" onbegin="add(#{rich:element('requests')});
#{rich:element('timeWatcher:grid')}.begin(); "
+
onbeforedomupdate="add(#{rich:element('updates')});"
oncomplete="#{rich:element('timeWatcher:grid')}.complete();
#{rich:element('timeWatcher:grid')}.difference(); ">
+
+ <a4j:attachQueue id="a4jAttachQueue1"
+
ignoreDupResponses="#{a4jAttachQueueBean.attributes['ignoreDupResponses'].value}"
+ name="namedQueue"
+
onrequestdequeue="#{a4jAttachQueueBean.attributes['onrequestdequeue'].value}"
+
onrequestqueue="#{a4jAttachQueueBean.attributes['onrequestqueue'].value}"
+
queueId="#{a4jAttachQueueBean.attributes['queueId'].value}"
+
rendered="#{a4jAttachQueueBean.attributes['rendered'].value}"
+
requestGroupingId="#{a4jAttachQueueBean.attributes['requestGroupingId'].value}"
+
timeout="#{a4jAttachQueueBean.attributes['timeout'].value}"/>
+ </a4j:ajax>
+ </h:inputText>
+
+ <a4j:ajax event="keypress" render="output2"
execute="@form" onbegin="add(#{rich:element('requests')});
#{rich:element('timeWatcher:grid')}.begin(); "
+
onbeforedomupdate="add(#{rich:element('updates')});"
oncomplete="#{rich:element('timeWatcher:grid')}.complete();
#{rich:element('timeWatcher:grid')}.difference(); ">
+
+ <a4j:attachQueue id="a4jAttachQueue2"
+
ignoreDupResponses="#{a4jAttachQueueBean.attributes['ignoreDupResponses'].value}"
+ name="namedQueue"
+
onrequestdequeue="#{a4jAttachQueueBean.attributes['onrequestdequeue'].value}"
+
onrequestqueue="#{a4jAttachQueueBean.attributes['onrequestqueue'].value}"
+
queueId="#{a4jAttachQueueBean.attributes['queueId'].value}"
+
rendered="#{a4jAttachQueueBean.attributes['rendered'].value}"
+
requestGroupingId="#{a4jAttachQueueBean.attributes['requestGroupingId'].value}"
+
timeout="#{a4jAttachQueueBean.attributes['timeout'].value}"/>
+
+ <h:inputText id="input2" value="#{a4jAttachQueueBean.text1}"
onkeypress="add(#{rich:element('events2')});
#{rich:element('timeWatcher:grid')}.event(2); " />
+ </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;"/>
+ Event 1 count:
+ <h:outputText value="0" id="events1" />
+ Event 2 count:
+ <h:outputText value="0" id="events2" />
+ Requests count:
+ <h:outputText value="0" id="requests" />
+ DOM updates count:
+ <h:outputText value="0" id="updates" />
+ </h:panelGrid>
+
+ <metamer:clientTimeWatcher id="timeWatcher" events="2"
/>
+
+ </ui:define>
+
+ <ui:define name="outOfTemplateAfter">
+ Attributes for first attach queue (first input)
+ <br/>
+ <metamer:attributes value="#{a4jAttachQueueBean.attributes}"
id="attributes1" exclude="name, requestDelay" />
+ <br/>
+ Attributes for second attach queue (second input)
+ <br/>
+ <metamer:attributes value="#{a4jAttachQueueBean.attributes2}"
id="attributes2" exclude="name, requestDelay" />
+ <br />
+ Attributes for queue1
+ <br />
+ <metamer:attributes value="#{a4jQueueBean.attributes}"
id="queueAttributes" exclude="name" />
+ </ui:define>
+
+ </ui:composition>
+</html>
\ No newline at end of file