Author: lfryc(a)redhat.com
Date: 2010-07-10 15:20:37 -0400 (Sat, 10 Jul 2010)
New Revision: 17841
Modified:
root/tests/metamer/trunk/pom.xml
root/tests/metamer/trunk/src/main/java/org/richfaces/testapp/bean/A4JPollBean.java
root/tests/metamer/trunk/src/main/java/org/richfaces/testapp/bean/A4JPushBean.java
root/tests/metamer/trunk/src/main/resources/org/richfaces/testapp/bean/A4JPollBean.properties
root/tests/metamer/trunk/src/main/resources/org/richfaces/testapp/bean/A4JPushBean.properties
root/tests/metamer/trunk/src/main/webapp/components/a4jPoll/simple.xhtml
root/tests/metamer/trunk/src/main/webapp/components/a4jPush/simple.xhtml
root/tests/metamer/trunk/src/main/webapp/resources/testapp/attributes.xhtml
Log:
RFPL-466
* attributes modified to submit form on change instead of on blur
* minor modifications of a4j:poll & a4j:push pages in order to make testing easier
Modified: root/tests/metamer/trunk/pom.xml
===================================================================
--- root/tests/metamer/trunk/pom.xml 2010-07-10 19:19:42 UTC (rev 17840)
+++ root/tests/metamer/trunk/pom.xml 2010-07-10 19:20:37 UTC (rev 17841)
@@ -114,7 +114,7 @@
<artifactId>servlet-api</artifactId>
<scope>provided</scope>
</dependency>
- <dependency>
+ <!-- <dependency>
<groupId>javax.el</groupId>
<artifactId>el-api</artifactId>
<scope>compile</scope>
@@ -124,7 +124,7 @@
<artifactId>el-impl</artifactId>
<version>2.2</version>
<scope>runtime</scope>
- </dependency>
+ </dependency>-->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
Modified:
root/tests/metamer/trunk/src/main/java/org/richfaces/testapp/bean/A4JPollBean.java
===================================================================
---
root/tests/metamer/trunk/src/main/java/org/richfaces/testapp/bean/A4JPollBean.java 2010-07-10
19:19:42 UTC (rev 17840)
+++
root/tests/metamer/trunk/src/main/java/org/richfaces/testapp/bean/A4JPollBean.java 2010-07-10
19:20:37 UTC (rev 17841)
@@ -61,7 +61,7 @@
attributes.put("rendered", true);
attributes.put("interval", 5000);
attributes.put("action", "increaseCounterAction");
- attributes.put("actionListener",
"increaseCounter3ActionListener");
+ attributes.put("actionListener",
"increaseCounterActionListener");
}
/**
@@ -105,12 +105,12 @@
return null;
}
- public void increaseCounter3ActionListener(ActionEvent event) {
- counter += 3;
+ public void increaseCounterActionListener(ActionEvent event) {
+ counter++;
}
- public void decreaseCounter3ActionListener(ActionEvent event) {
- counter -= 3;
+ public void decreaseCounterActionListener(ActionEvent event) {
+ counter--;
}
}
Modified:
root/tests/metamer/trunk/src/main/java/org/richfaces/testapp/bean/A4JPushBean.java
===================================================================
---
root/tests/metamer/trunk/src/main/java/org/richfaces/testapp/bean/A4JPushBean.java 2010-07-10
19:19:42 UTC (rev 17840)
+++
root/tests/metamer/trunk/src/main/java/org/richfaces/testapp/bean/A4JPushBean.java 2010-07-10
19:20:37 UTC (rev 17841)
@@ -19,10 +19,10 @@
* 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.testapp.bean;
import java.io.Serializable;
-import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.EventListener;
import java.util.EventObject;
@@ -53,7 +53,6 @@
private Attributes attributes;
private int counter = 0;
private transient volatile PushEventListener listener;
- private String formattedDate = null;
/**
* Initializes the managed bean.
@@ -66,7 +65,7 @@
attributes = Attributes.getUIComponentAttributes(UIPush.class, getClass());
attributes.put("interval", 1000);
attributes.put("action", "increaseCounterAction");
- attributes.put("actionListener",
"increaseCounter3ActionListener");
+ attributes.put("actionListener",
"increaseCounterActionListener");
attributes.put("rendered", true);
attributes.put("enabled", true);
@@ -115,20 +114,16 @@
return null;
}
- public void increaseCounter3ActionListener(ActionEvent event) {
- counter += 3;
+ public void increaseCounterActionListener(ActionEvent event) {
+ counter++;
}
- public void decreaseCounter3ActionListener(ActionEvent event) {
- counter -= 3;
+ public void decreaseCounterActionListener(ActionEvent event) {
+ counter--;
}
- public String getDateString() {
- if (formattedDate == null) {
- formattedDate = new SimpleDateFormat("HH:mm:ss SSSS").format(new
Date());
- }
-
- return formattedDate;
+ public Date getDate() {
+ return new Date();
}
}
Modified:
root/tests/metamer/trunk/src/main/resources/org/richfaces/testapp/bean/A4JPollBean.properties
===================================================================
---
root/tests/metamer/trunk/src/main/resources/org/richfaces/testapp/bean/A4JPollBean.properties 2010-07-10
19:19:42 UTC (rev 17840)
+++
root/tests/metamer/trunk/src/main/resources/org/richfaces/testapp/bean/A4JPollBean.properties 2010-07-10
19:20:37 UTC (rev 17841)
@@ -1,5 +1,7 @@
attr.action.increaseCounterAction=increaseCounterAction
attr.action.decreaseCounterAction=decreaseCounterAction
+attr.action.none=
-attr.actionListener.increaseCounter3ActionListener=increaseCounter3ActionListener
-attr.actionListener.decreaseCounter3ActionListener=decreaseCounter3ActionListener
\ No newline at end of file
+attr.actionListener.increaseCounterActionListener=increaseCounterActionListener
+attr.actionListener.decreaseCounterActionListener=decreaseCounterActionListener
+attr.actionListener.none=
\ No newline at end of file
Modified:
root/tests/metamer/trunk/src/main/resources/org/richfaces/testapp/bean/A4JPushBean.properties
===================================================================
---
root/tests/metamer/trunk/src/main/resources/org/richfaces/testapp/bean/A4JPushBean.properties 2010-07-10
19:19:42 UTC (rev 17840)
+++
root/tests/metamer/trunk/src/main/resources/org/richfaces/testapp/bean/A4JPushBean.properties 2010-07-10
19:20:37 UTC (rev 17841)
@@ -1,5 +1,7 @@
attr.action.increaseCounterAction=increaseCounterAction
attr.action.decreaseCounterAction=decreaseCounterAction
+attr.action.none=
-attr.actionListener.increaseCounter3ActionListener=increaseCounter3ActionListener
-attr.actionListener.decreaseCounter3ActionListener=decreaseCounter3ActionListener
\ No newline at end of file
+attr.actionListener.increaseCounterActionListener=increaseCounterActionListener
+attr.actionListener.decreaseCounterActionListener=decreaseCounterActionListener
+attr.actionListener.none=
\ No newline at end of file
Modified: root/tests/metamer/trunk/src/main/webapp/components/a4jPoll/simple.xhtml
===================================================================
--- root/tests/metamer/trunk/src/main/webapp/components/a4jPoll/simple.xhtml 2010-07-10
19:19:42 UTC (rev 17840)
+++ root/tests/metamer/trunk/src/main/webapp/components/a4jPoll/simple.xhtml 2010-07-10
19:20:37 UTC (rev 17841)
@@ -38,7 +38,9 @@
</h:panelGroup>
<h:panelGroup id="time">
- #{a4jPollBean.date} *** #{a4jPollBean.counter}
+ <h:outputText id="outputDate"
value="#{a4jPollBean.date}"/>
+ ***
+ <h:outputText id="outputCounter"
value="#{a4jPollBean.counter}"/>
</h:panelGroup>
</ui:define>
Modified: root/tests/metamer/trunk/src/main/webapp/components/a4jPush/simple.xhtml
===================================================================
--- root/tests/metamer/trunk/src/main/webapp/components/a4jPush/simple.xhtml 2010-07-10
19:19:42 UTC (rev 17840)
+++ root/tests/metamer/trunk/src/main/webapp/components/a4jPush/simple.xhtml 2010-07-10
19:20:37 UTC (rev 17841)
@@ -18,9 +18,11 @@
</ui:define>
<ui:define name="component">
- <h:panelGrid columns="2">
- Time: <h:panelGroup id="time">#{a4jPushBean.dateString} *
#{a4jPushBean.counter}</h:panelGroup>
- </h:panelGrid>
+
+ <h:outputText id="outputDate"
value="#{a4jPushBean.date}"/>
+ ***
+ <h:outputText id="outputCounter"
value="#{a4jPushBean.counter}"/>
+
<a4j:push id="push"
action="#{a4jPushBean.attributes.action}"
actionListener="#{a4jPushBean.attributes.actionListener}"
@@ -37,11 +39,13 @@
rendered="#{a4jPushBean.attributes['rendered']}"
value="#{a4jPushBean.attributes['value']}"
- <f:ajax
render="#{'form:time'}" />
+ <a4j:ajax render="outputDate, outputCounter" />
<f:param name="testParam" value="testValue" />
<f:param name="testParam1" value="testValue1"
/>
</a4j:push>
+ <br/>
+
<h:commandLink value="Generate push event"
action="#{a4jPushBean.generateEvent}">
<f:ajax render="@none" />
</h:commandLink>
Modified: root/tests/metamer/trunk/src/main/webapp/resources/testapp/attributes.xhtml
===================================================================
--- root/tests/metamer/trunk/src/main/webapp/resources/testapp/attributes.xhtml 2010-07-10
19:19:42 UTC (rev 17840)
+++ root/tests/metamer/trunk/src/main/webapp/resources/testapp/attributes.xhtml 2010-07-10
19:20:37 UTC (rev 17841)
@@ -40,7 +40,7 @@
</c:when>
<c:otherwise>
- <h:inputText id="#{entry.key}Input"
value="#{cc.attrs.value[entry.key]}" style="width: 200px;"
onblur="submit()" />
+ <h:inputText id="#{entry.key}Input"
value="#{cc.attrs.value[entry.key]}" style="width: 200px;"
onchange="submit()" />
</c:otherwise>
</c:choose>