Author: lfryc(a)redhat.com
Date: 2010-07-10 15:28:48 -0400 (Sat, 10 Jul 2010)
New Revision: 17848
Modified:
root/tests/metamer/trunk/src/main/java/org/richfaces/testapp/RichPhaseListener.java
root/tests/metamer/trunk/src/main/java/org/richfaces/testapp/bean/A4JCommandButtonBean.java
root/tests/metamer/trunk/src/main/java/org/richfaces/testapp/bean/A4JCommandLinkBean.java
root/tests/metamer/trunk/src/main/java/org/richfaces/testapp/bean/PhasesBean.java
root/tests/metamer/trunk/src/main/java/org/richfaces/testapp/bean/RichBean.java
root/tests/metamer/trunk/src/main/webapp/components/a4jCommandButton/simple.xhtml
root/tests/metamer/trunk/src/main/webapp/components/a4jCommandLink/simple.xhtml
root/tests/metamer/trunk/src/main/webapp/templates/header.xhtml
Log:
RFPL-466
* phase listener refactored
* added log for action and action listener that will show up on page
* added attribute limitRender to pages with a4j link and button
Modified:
root/tests/metamer/trunk/src/main/java/org/richfaces/testapp/RichPhaseListener.java
===================================================================
---
root/tests/metamer/trunk/src/main/java/org/richfaces/testapp/RichPhaseListener.java 2010-07-10
19:28:04 UTC (rev 17847)
+++
root/tests/metamer/trunk/src/main/java/org/richfaces/testapp/RichPhaseListener.java 2010-07-10
19:28:48 UTC (rev 17848)
@@ -59,8 +59,8 @@
FacesContext ctx = event.getFacesContext();
ExpressionFactory factory = ctx.getApplication().getExpressionFactory();
ValueExpression exp = factory.createValueExpression(ctx.getELContext(),
"#{phasesBean.phases}", List.class);
- List<PhaseEvent> phases = (List<PhaseEvent>)
exp.getValue(ctx.getELContext());
- phases.add(event);
+ List<String> phases = (List<String>)
exp.getValue(ctx.getELContext());
+ phases.add(event.getPhaseId().toString());
}
/**
Modified:
root/tests/metamer/trunk/src/main/java/org/richfaces/testapp/bean/A4JCommandButtonBean.java
===================================================================
---
root/tests/metamer/trunk/src/main/java/org/richfaces/testapp/bean/A4JCommandButtonBean.java 2010-07-10
19:28:04 UTC (rev 17847)
+++
root/tests/metamer/trunk/src/main/java/org/richfaces/testapp/bean/A4JCommandButtonBean.java 2010-07-10
19:28:48 UTC (rev 17848)
@@ -134,7 +134,8 @@
* @return null since no navigation should be performed
*/
public String first6CharsAction() {
- logger.info("action invoked");
+ RichBean.logToPage("action invoked");
+
if (input == null) {
return "";
} else {
@@ -150,6 +151,8 @@
* @return null since no navigation should be performed
*/
public String doubleStringAction() {
+ RichBean.logToPage("action invoked");
+
if (input == null) {
input2 = "";
} else {
@@ -165,6 +168,8 @@
* @return null since no navigation should be performed
*/
public String toUpperCaseAction() {
+ RichBean.logToPage("action invoked");
+
if (input == null) {
return "";
} else {
@@ -180,6 +185,8 @@
* an event representing the activation of a user interface component (not
used)
*/
public void first6CharsActionListener(ActionEvent event) {
+ RichBean.logToPage("action listener invoked");
+
if (input == null) {
input3 = "";
} else {
@@ -195,6 +202,8 @@
* an event representing the activation of a user interface component (not
used)
*/
public void doubleStringActionListener(ActionEvent event) {
+ RichBean.logToPage("action listener invoked");
+
if (input == null) {
input3 = "";
} else {
@@ -209,11 +218,12 @@
* an event representing the activation of a user interface component (not
used)
*/
public void toUpperCaseActionListener(ActionEvent event) {
+ RichBean.logToPage("action listener invoked");
+
if (input == null) {
input3 = "";
} else {
input3 = input.toUpperCase();
}
}
-
}
Modified:
root/tests/metamer/trunk/src/main/java/org/richfaces/testapp/bean/A4JCommandLinkBean.java
===================================================================
---
root/tests/metamer/trunk/src/main/java/org/richfaces/testapp/bean/A4JCommandLinkBean.java 2010-07-10
19:28:04 UTC (rev 17847)
+++
root/tests/metamer/trunk/src/main/java/org/richfaces/testapp/bean/A4JCommandLinkBean.java 2010-07-10
19:28:48 UTC (rev 17848)
@@ -134,6 +134,8 @@
* @return null since no navigation should be performed
*/
public String first6CharsAction() {
+ RichBean.logToPage("action invoked");
+
if (input == null) {
return "";
} else {
@@ -149,6 +151,8 @@
* @return null since no navigation should be performed
*/
public String doubleStringAction() {
+ RichBean.logToPage("action invoked");
+
if (input == null) {
input2 = "";
} else {
@@ -164,6 +168,8 @@
* @return null since no navigation should be performed
*/
public String toUpperCaseAction() {
+ RichBean.logToPage("action invoked");
+
if (input == null) {
return "";
} else {
@@ -179,6 +185,8 @@
* an event representing the activation of a user interface component (not
used)
*/
public void first6CharsActionListener(ActionEvent event) {
+ RichBean.logToPage("action listener invoked");
+
if (input == null) {
input3 = "";
} else {
@@ -194,6 +202,8 @@
* an event representing the activation of a user interface component (not
used)
*/
public void doubleStringActionListener(ActionEvent event) {
+ RichBean.logToPage("action listener invoked");
+
if (input == null) {
input3 = "";
} else {
@@ -208,6 +218,8 @@
* an event representing the activation of a user interface component (not
used)
*/
public void toUpperCaseActionListener(ActionEvent event) {
+ RichBean.logToPage("action listener invoked");
+
if (input == null) {
input3 = "";
} else {
Modified:
root/tests/metamer/trunk/src/main/java/org/richfaces/testapp/bean/PhasesBean.java
===================================================================
---
root/tests/metamer/trunk/src/main/java/org/richfaces/testapp/bean/PhasesBean.java 2010-07-10
19:28:04 UTC (rev 17847)
+++
root/tests/metamer/trunk/src/main/java/org/richfaces/testapp/bean/PhasesBean.java 2010-07-10
19:28:48 UTC (rev 17848)
@@ -29,7 +29,6 @@
import javax.annotation.PostConstruct;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;
-import javax.faces.event.PhaseEvent;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -45,7 +44,7 @@
public class PhasesBean {
private static Logger logger;
- private List<PhaseEvent> phases;
+ private List<String> phases;
/**
* Initializes the managed bean.
@@ -54,14 +53,14 @@
public void init() {
logger = LoggerFactory.getLogger(getClass());
logger.debug("initializing bean " + getClass().getName());
- phases = new ArrayList<PhaseEvent>();
+ phases = new ArrayList<String>();
}
- public List<PhaseEvent> getPhases() {
+ public List<String> getPhases() {
return phases;
}
- public void setPhases(List<PhaseEvent> phases) {
+ public void setPhases(List<String> phases) {
this.phases = phases;
}
Modified: root/tests/metamer/trunk/src/main/java/org/richfaces/testapp/bean/RichBean.java
===================================================================
---
root/tests/metamer/trunk/src/main/java/org/richfaces/testapp/bean/RichBean.java 2010-07-10
19:28:04 UTC (rev 17847)
+++
root/tests/metamer/trunk/src/main/java/org/richfaces/testapp/bean/RichBean.java 2010-07-10
19:28:48 UTC (rev 17848)
@@ -30,6 +30,8 @@
import java.util.TreeMap;
import javax.annotation.PostConstruct;
+import javax.el.ExpressionFactory;
+import javax.el.ValueExpression;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;
import javax.faces.context.FacesContext;
@@ -259,4 +261,12 @@
throw new IllegalStateException();
}
+
+ public static void logToPage(String msg) {
+ FacesContext ctx = FacesContext.getCurrentInstance();
+ ExpressionFactory factory = ctx.getApplication().getExpressionFactory();
+ ValueExpression exp = factory.createValueExpression(ctx.getELContext(),
"#{phasesBean.phases}", List.class);
+ List<String> phases = (List<String>)
exp.getValue(ctx.getELContext());
+ phases.add(msg);
+ }
}
Modified:
root/tests/metamer/trunk/src/main/webapp/components/a4jCommandButton/simple.xhtml
===================================================================
---
root/tests/metamer/trunk/src/main/webapp/components/a4jCommandButton/simple.xhtml 2010-07-10
19:28:04 UTC (rev 17847)
+++
root/tests/metamer/trunk/src/main/webapp/components/a4jCommandButton/simple.xhtml 2010-07-10
19:28:48 UTC (rev 17848)
@@ -29,6 +29,7 @@
bypassUpdates="#{a4jButtonBean.attributes['bypassUpdates']}"
disabled="#{a4jButtonBean.attributes['disabled']}"
immediate="#{a4jButtonBean.attributes['immediate']}"
+
limitRender="#{a4jButtonBean.attributes['limitRender']}"
onclick="#{a4jButtonBean.attributes['onclick']}"
ondblclick="#{a4jButtonBean.attributes['ondblclick']}"
onkeydown="#{a4jButtonBean.attributes['onkeydown']}"
Modified: root/tests/metamer/trunk/src/main/webapp/components/a4jCommandLink/simple.xhtml
===================================================================
---
root/tests/metamer/trunk/src/main/webapp/components/a4jCommandLink/simple.xhtml 2010-07-10
19:28:04 UTC (rev 17847)
+++
root/tests/metamer/trunk/src/main/webapp/components/a4jCommandLink/simple.xhtml 2010-07-10
19:28:48 UTC (rev 17848)
@@ -29,6 +29,7 @@
bypassUpdates="#{a4jLinkBean.attributes['bypassUpdates']}"
disabled="#{a4jLinkBean.attributes['disabled']}"
immediate="#{a4jLinkBean.attributes['immediate']}"
+
limitRender="#{a4jLinkBean.attributes['limitRender']}"
onclick="#{a4jLinkBean.attributes['onclick']}"
ondblclick="#{a4jLinkBean.attributes['ondblclick']}"
onkeydown="#{a4jLinkBean.attributes['onkeydown']}"
Modified: root/tests/metamer/trunk/src/main/webapp/templates/header.xhtml
===================================================================
--- root/tests/metamer/trunk/src/main/webapp/templates/header.xhtml 2010-07-10 19:28:04
UTC (rev 17847)
+++ root/tests/metamer/trunk/src/main/webapp/templates/header.xhtml 2010-07-10 19:28:48
UTC (rev 17848)
@@ -65,13 +65,13 @@
</h:panelGrid>
<h:panelGrid columns="1">
- <a4j:outputPanel layout="block"
ajaxRendered="true">
+ <a4j:outputPanel id="phasesPanel" layout="block"
ajaxRendered="true">
<h:outputText id="requestTime"
value="#{phasesBean.date}">
<f:convertDateTime pattern="HH:mm:ss.SSS"/>
</h:outputText>
<ul>
<a4j:repeat value="#{phasesBean.phases}"
var="phase">
- <li>#{phase.phaseId}</li>
+ <li>#{phase}</li>
</a4j:repeat>
</ul>
</a4j:outputPanel>