[richfaces-svn-commits] JBoss Rich Faces SVN: r18717 - in modules/tests/metamer/trunk/application/src/main: webapp/components/a4jStatus and 1 other directory.
richfaces-svn-commits at lists.jboss.org
richfaces-svn-commits at lists.jboss.org
Tue Aug 17 11:56:30 EDT 2010
Author: lfryc at redhat.com
Date: 2010-08-17 11:56:29 -0400 (Tue, 17 Aug 2010)
New Revision: 18717
Modified:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JStatusBean.java
modules/tests/metamer/trunk/application/src/main/webapp/components/a4jStatus/simple.xhtml
Log:
a4j:status - add support for testing facets content and their instant changes (RFPL-735)
Modified: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JStatusBean.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JStatusBean.java 2010-08-17 15:26:45 UTC (rev 18716)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JStatusBean.java 2010-08-17 15:56:29 UTC (rev 18717)
@@ -36,7 +36,7 @@
/**
* Managed bean for a4j:status.
- *
+ *
* @author <a href="mailto:ppitonak at redhat.com">Pavol Pitonak</a>
* @version $Revision$
*/
@@ -47,6 +47,10 @@
private static final long serialVersionUID = -1L;
private static Logger logger;
private Attributes attributes;
+
+ private String facetStartValue = "START";
+ private String facetStopValue = "STOP";
+ private String facetErrorValue = "ERROR";
/**
* Initializes the managed bean.
@@ -67,12 +71,37 @@
public void setAttributes(Attributes attributes) {
this.attributes = attributes;
}
+
+ public String getFacetStartValue() {
+ return facetStartValue;
+ }
+ public void setFacetStartValue(String facetStartValue) {
+ this.facetStartValue = facetStartValue;
+ }
+
+ public String getFacetStopValue() {
+ return facetStopValue;
+ }
+
+ public void setFacetStopValue(String facetStopValue) {
+ this.facetStopValue = facetStopValue;
+ }
+
+ public String getFacetErrorValue() {
+ return facetErrorValue;
+ }
+
+ public void setFacetErrorValue(String facetErrorValue) {
+ this.facetErrorValue = facetErrorValue;
+ }
+
/**
* Action that causes an error. Suitable for testing 'onerror' attribute.
*
* @return method never returns any value
- * @throws ValidationException thrown always
+ * @throws ValidationException
+ * thrown always
*/
public String causeError() {
throw new ValidatorException(new FacesMessage("Ajax request caused an error."));
@@ -81,8 +110,9 @@
/**
* Action that creates a 2-second delay.
*
- * @throws InterruptedException if any thread has interrupted the current thread. The interrupted
- * status of the current thread is cleared when this exception is thrown.
+ * @throws InterruptedException
+ * if any thread has interrupted the current thread. The interrupted status of the current thread is
+ * cleared when this exception is thrown.
*/
public void delay() throws InterruptedException {
Thread.sleep(2000);
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/a4jStatus/simple.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/a4jStatus/simple.xhtml 2010-08-17 15:26:45 UTC (rev 18716)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/a4jStatus/simple.xhtml 2010-08-17 15:56:29 UTC (rev 18717)
@@ -37,6 +37,21 @@
</ui:define>
<ui:define name="outOfTemplateBefore">
+ <fieldset>
+ <legend>facets settings</legend>
+ <h:panelGrid id="facetGrid" columns="2">
+ <h:outputText value="Facet Start: " />
+ <h:inputText value="#{a4jStatusBean.facetStartValue}" />
+
+ <h:outputText value="Facet Stop: " />
+ <h:inputText value="#{a4jStatusBean.facetStopValue}" />
+
+ <h:outputText value="Facet Error: " />
+ <h:inputText value="#{a4jStatusBean.facetErrorValue}" />
+ </h:panelGrid>
+
+ <a4j:commandButton render="status,facetGrid" execute="facetGrid" />
+ </fieldset>
</ui:define>
<ui:define name="component">
@@ -51,9 +66,18 @@
onsuccess="#{a4jStatusBean.attributes['onsuccess'].value}"
rendered="#{a4jStatusBean.attributes['rendered'].value}"
value="#{a4jStatusBean.attributes['value'].value}">
+
<f:facet name="start">
- <h:outputText id="statusText" style="font-size: large; color: red;" value="WORKING"/>
+ <h:outputText id="statusTextStart" style="font-size: large; color: red;" value="#{a4jStatusBean.facetStartValue}" rendered="#{not empty a4jStatusBean.facetStartValue}"/>
</f:facet>
+
+ <f:facet name="stop">
+ <h:outputText id="statusTextStop" style="font-size: large; color: red;" value="#{a4jStatusBean.facetStopValue}" rendered="#{not empty a4jStatusBean.facetStopValue}"/>
+ </f:facet>
+
+ <f:facet name="error">
+ <h:outputText id="statusTextError" style="font-size: large; color: red;" value="#{a4jStatusBean.facetErrorValue}" rendered="#{not empty a4jStatusBean.facetErrorValue}"/>
+ </f:facet>
</a4j:status>
</fieldset>
More information about the richfaces-svn-commits
mailing list