JBoss Rich Faces SVN: r21483 - modules/tests/metamer/trunk/application/src/main/webapp/components/richTree.
by richfaces-svn-commits@lists.jboss.org
Author: lfryc(a)redhat.com
Date: 2011-02-05 09:58:29 -0500 (Sat, 05 Feb 2011)
New Revision: 21483
Modified:
modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/simple.xhtml
Log:
rich:treeNode - type in name of @onmouseup (RF-10408)
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/simple.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/simple.xhtml 2011-02-05 14:51:17 UTC (rev 21482)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/simple.xhtml 2011-02-05 14:58:29 UTC (rev 21483)
@@ -119,7 +119,7 @@
onmousemove="#{richTreeNodeBean.attributes[0]['onmousemove'].value}"
onmouseout="#{richTreeNodeBean.attributes[0]['onmouseout'].value}"
onmouseover="#{richTreeNodeBean.attributes[0]['onmouseover'].value}"
- onomouseup="#{richTreeNodeBean.attributes[0]['onomouseup'].value}"
+ onmouseup="#{richTreeNodeBean.attributes[0]['onmouseup'].value}"
ontoggle="#{richTreeNodeBean.attributes[0]['ontoggle'].value}"
rendered="#{richTreeNodeBean.attributes[0]['rendered'].value}"
style="#{richTreeNodeBean.attributes[0]['style'].value}"
@@ -154,7 +154,7 @@
onmousemove="#{richTreeNodeBean.attributes[1]['onmousemove'].value}"
onmouseout="#{richTreeNodeBean.attributes[1]['onmouseout'].value}"
onmouseover="#{richTreeNodeBean.attributes[1]['onmouseover'].value}"
- onomouseup="#{richTreeNodeBean.attributes[1]['onomouseup'].value}"
+ onmouseup="#{richTreeNodeBean.attributes[0]['onmouseup'].value}"
ontoggle="#{richTreeNodeBean.attributes[1]['ontoggle'].value}"
rendered="#{richTreeNodeBean.attributes[1]['rendered'].value}"
style="#{richTreeNodeBean.attributes[1]['style'].value}"
@@ -190,7 +190,7 @@
onmousemove="#{richTreeNodeBean.attributes[2]['onmousemove'].value}"
onmouseout="#{richTreeNodeBean.attributes[2]['onmouseout'].value}"
onmouseover="#{richTreeNodeBean.attributes[2]['onmouseover'].value}"
- onomouseup="#{richTreeNodeBean.attributes[2]['onomouseup'].value}"
+ onmouseup="#{richTreeNodeBean.attributes[0]['onmouseup'].value}"
ontoggle="#{richTreeNodeBean.attributes[2]['ontoggle'].value}"
rendered="#{richTreeNodeBean.attributes[2]['rendered'].value}"
style="#{richTreeNodeBean.attributes[2]['style'].value}"
15 years, 2 months
JBoss Rich Faces SVN: r21482 - modules/tests/metamer/trunk/application/src/main/webapp/components/a4jQueue.
by richfaces-svn-commits@lists.jboss.org
Author: lfryc(a)redhat.com
Date: 2011-02-05 09:51:17 -0500 (Sat, 05 Feb 2011)
New Revision: 21482
Modified:
modules/tests/metamer/trunk/application/src/main/webapp/components/a4jQueue/formQueue.xhtml
Log:
a4j:queue - formQueue sample fixed - used value for dontRenderForm as ui:param (RFPL-1105, RF-9721)
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/a4jQueue/formQueue.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/a4jQueue/formQueue.xhtml 2011-02-05 14:50:50 UTC (rev 21481)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/a4jQueue/formQueue.xhtml 2011-02-05 14:51:17 UTC (rev 21482)
@@ -28,13 +28,13 @@
-->
<ui:composition template="/templates/template.xhtml">
+ <ui:param name="dontRenderForm" value="true" />
<ui:define name="head">
<f:metadata>
<f:viewParam name="templates" value="#{templateBean.templates}">
<f:converter converterId="templatesListConverter" />
</f:viewParam>
- <c:set var="dontRenderForm" value="#{true}" />
</f:metadata>
<h:outputStylesheet library="css" name="a4jQueue.css" />
</ui:define>
15 years, 2 months
JBoss Rich Faces SVN: r21481 - modules/tests/metamer/trunk/application/src/main/webapp/components/a4jAttachQueue.
by richfaces-svn-commits@lists.jboss.org
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
15 years, 2 months
JBoss Rich Faces SVN: r21480 - modules/tests/metamer/trunk/application/src/main/webapp/resources/metamer.
by richfaces-svn-commits@lists.jboss.org
Author: lfryc(a)redhat.com
Date: 2011-02-05 09:50:20 -0500 (Sat, 05 Feb 2011)
New Revision: 21480
Modified:
modules/tests/metamer/trunk/application/src/main/webapp/resources/metamer/attributes.xhtml
Log:
metamer:attributes - added @exclude parameter to be able exclude some attributes from page (e.g. if they doesn't make sense in given scenario)
Modified: modules/tests/metamer/trunk/application/src/main/webapp/resources/metamer/attributes.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/resources/metamer/attributes.xhtml 2011-02-05 14:49:51 UTC (rev 21479)
+++ modules/tests/metamer/trunk/application/src/main/webapp/resources/metamer/attributes.xhtml 2011-02-05 14:50:20 UTC (rev 21480)
@@ -12,6 +12,7 @@
<composite:attribute name="execute" default="@form" />
<composite:attribute name="columns" default="2" type="int" shortDescription="The number of columns into which list of attributes will be rendered" />
<composite:attribute name="type" default="server" type="java.lang.String" shortDescription="The type of request done for changing the attribute (server/ajax)" />
+ <composite:attribute name="exclude" default="" />
</composite:interface>
<composite:implementation>
@@ -24,47 +25,49 @@
<h:panelGrid id="#{cc.attrs.id}" columns="#{cc.attrs.columns * 2}" styleClass="attributes"
columnClasses="attributes-first-column, attributes-second-column, attributes-first-column, attributes-second-column">
<c:forEach items="#{cc.attrs.value}" var="entry">
- <h:panelGroup layout="block">
- <h:outputLabel id="#{entry.key}Label" value="#{entry.key}" style="margin-right: 5px;" for="#{entry.key}Input"/>
- <h:graphicImage value="/resources/images/help.png" title="#{entry.value.help}"
- rendered="#{entry.value.help != null}" height="18px;"
- style="vertical-align: middle;" styleClass="attribute-help" >
- </h:graphicImage>
- </h:panelGroup>
+ <c:if test="#{not fn:contains(cc.attrs.exclude, entry.key)}">
+ <h:panelGroup layout="block">
+ <h:outputLabel id="#{entry.key}Label" value="#{entry.key}" style="margin-right: 5px;" for="#{entry.key}Input"/>
+ <h:graphicImage value="/resources/images/help.png" title="#{entry.value.help}"
+ rendered="#{entry.value.help != null}" height="18px;"
+ style="vertical-align: middle;" styleClass="attribute-help" >
+ </h:graphicImage>
+ </h:panelGroup>
+
+ <c:choose>
+ <c:when test="#{entry.value.bool}">
+ <h:selectOneRadio id="#{entry.key}Input" value="#{entry.value.value}" onchange="#{cc.attrs.type == 'server' ? 'submit()' : 'submitAjax()'}">
+ <f:selectItem itemValue="null" itemLabel="null"/>
+ <f:selectItem itemValue="true" itemLabel="true"/>
+ <f:selectItem itemValue="false" itemLabel="false"/>
+ </h:selectOneRadio>
+ </c:when>
+
+ <c:when test="#{entry.value.selectOptions != null}">
+ <c:choose>
+ <c:when test="#{fn:length(entry.value.selectOptions) > 4}">
+ <h:selectOneMenu id="#{entry.key}Input" value="#{entry.value.value}"
+ onchange="#{cc.attrs.type == 'server' ? 'submit()' : 'submitAjax()'}"
+ style="width: 100%">
+ <f:selectItems value="#{entry.value.selectOptions}" noSelectionValue="null" />
+ </h:selectOneMenu>
+ </c:when>
+ <c:otherwise>
+ <h:selectOneRadio id="#{entry.key}Input" value="#{entry.value.value}"
+ onchange="#{cc.attrs.type == 'server' ? 'submit()' : 'submitAjax()'}"
+ layout="pageDirection">
+ <f:selectItems value="#{entry.value.selectOptions}" />
+ </h:selectOneRadio>
+ </c:otherwise>
+ </c:choose>
+ </c:when>
+
+ <c:otherwise>
+ <h:inputText id="#{entry.key}Input" value="#{entry.value.value}" style="width: 200px;" onchange="#{cc.attrs.type == 'server' ? 'submit()' : 'submitAjax()'}" />
+ </c:otherwise>
+ </c:choose>
+ </c:if>
- <c:choose>
- <c:when test="#{entry.value.bool}">
- <h:selectOneRadio id="#{entry.key}Input" value="#{entry.value.value}" onchange="#{cc.attrs.type == 'server' ? 'submit()' : 'submitAjax()'}">
- <f:selectItem itemValue="null" itemLabel="null"/>
- <f:selectItem itemValue="true" itemLabel="true"/>
- <f:selectItem itemValue="false" itemLabel="false"/>
- </h:selectOneRadio>
- </c:when>
-
- <c:when test="#{entry.value.selectOptions != null}">
- <c:choose>
- <c:when test="#{fn:length(entry.value.selectOptions) > 4}">
- <h:selectOneMenu id="#{entry.key}Input" value="#{entry.value.value}"
- onchange="#{cc.attrs.type == 'server' ? 'submit()' : 'submitAjax()'}"
- style="width: 100%">
- <f:selectItems value="#{entry.value.selectOptions}" noSelectionValue="null" />
- </h:selectOneMenu>
- </c:when>
- <c:otherwise>
- <h:selectOneRadio id="#{entry.key}Input" value="#{entry.value.value}"
- onchange="#{cc.attrs.type == 'server' ? 'submit()' : 'submitAjax()'}"
- layout="pageDirection">
- <f:selectItems value="#{entry.value.selectOptions}" />
- </h:selectOneRadio>
- </c:otherwise>
- </c:choose>
- </c:when>
-
- <c:otherwise>
- <h:inputText id="#{entry.key}Input" value="#{entry.value.value}" style="width: 200px;" onchange="#{cc.attrs.type == 'server' ? 'submit()' : 'submitAjax()'}" />
- </c:otherwise>
- </c:choose>
-
</c:forEach>
</h:panelGrid>
</a4j:outputPanel>
15 years, 2 months
JBoss Rich Faces SVN: r21479 - in modules/tests/metamer/trunk: ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jPoll and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: lfryc(a)redhat.com
Date: 2011-02-05 09:49:51 -0500 (Sat, 05 Feb 2011)
New Revision: 21479
Added:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jPoll/PollAttributes.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jPoll/TestPollInterval.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jPoll/TestPollSimple.java
Removed:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jPoll/IntervalAttributes.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jPoll/TestInterval.java
Modified:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JPollBean.java
Log:
a4j:poll - covered all remaining attributes (RFPL-1064)
Modified: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JPollBean.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JPollBean.java 2011-02-05 14:48:44 UTC (rev 21478)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/A4JPollBean.java 2011-02-05 14:49:51 UTC (rev 21479)
@@ -26,10 +26,10 @@
import javax.annotation.PostConstruct;
import javax.faces.bean.ManagedBean;
-import javax.faces.bean.SessionScoped;
+import javax.faces.bean.ViewScoped;
import javax.faces.event.ActionEvent;
+
import org.richfaces.component.UIPoll;
-
import org.richfaces.tests.metamer.Attributes;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -41,7 +41,7 @@
* @version $Revision$
*/
@ManagedBean(name = "a4jPollBean")
-@SessionScoped
+@ViewScoped
public class A4JPollBean implements Serializable {
private static final long serialVersionUID = 4810889475400649809L;
Deleted: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jPoll/IntervalAttributes.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jPoll/IntervalAttributes.java 2011-02-05 14:48:44 UTC (rev 21478)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jPoll/IntervalAttributes.java 2011-02-05 14:49:51 UTC (rev 21479)
@@ -1,40 +0,0 @@
-/*******************************************************************************
- * 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.ftest.a4jPoll;
-
-import org.richfaces.tests.metamer.ftest.AbstractComponentAttributes;
-
-/**
- * Tests the a4j:poll component.
- *
- * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
- * @version $Revision$
- */
-public class IntervalAttributes extends AbstractComponentAttributes {
- public void setEnabled(boolean enabled) {
- setProperty("enabled", enabled);
- }
-
- public void setInterval(long interval) {
- setProperty("interval", interval);
- }
-}
Added: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jPoll/PollAttributes.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jPoll/PollAttributes.java (rev 0)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jPoll/PollAttributes.java 2011-02-05 14:49:51 UTC (rev 21479)
@@ -0,0 +1,84 @@
+/*******************************************************************************
+ * 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.ftest.a4jPoll;
+
+import org.richfaces.tests.metamer.ftest.AbstractComponentAttributes;
+
+/**
+ * Tests the a4j:poll component.
+ *
+ * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
+ * @version $Revision$
+ */
+public class PollAttributes extends AbstractComponentAttributes {
+ public void setEnabled(boolean enabled) {
+ setProperty("enabled", enabled);
+ }
+
+ public void setInterval(long interval) {
+ setProperty("interval", interval);
+ }
+
+ public void setAction(String action) {
+ setProperty("action", action);
+ }
+
+ public void setActionListener(String actionListener) {
+ setProperty("actionListener", actionListener);
+ }
+
+ public void setBypassUpdates(Boolean bypassUpdates) {
+ setProperty("bypassUpdates", bypassUpdates);
+ }
+
+ public void setData(String data) {
+ setProperty("data", data);
+ }
+
+ public void setExecute(String execute) {
+ setProperty("execute", execute);
+ }
+
+ public void setImmediate(Boolean immediate) {
+ setProperty("immediate", immediate);
+ }
+
+ public void setInterval(Integer interval) {
+ setProperty("interval", interval);
+ }
+
+ public void setLimitRender(Boolean limitRender) {
+ setProperty("limitRender", limitRender);
+ }
+
+ public void setRender(String render) {
+ setProperty("render", render);
+ }
+
+ public void setRendered(Boolean rendered) {
+ setProperty("rendered", rendered);
+ }
+
+ public void setStatus(String status) {
+ setProperty("status", status);
+ }
+}
Deleted: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jPoll/TestInterval.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jPoll/TestInterval.java 2011-02-05 14:48:44 UTC (rev 21478)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jPoll/TestInterval.java 2011-02-05 14:49:51 UTC (rev 21479)
@@ -1,174 +0,0 @@
-/*******************************************************************************
- * 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.ftest.a4jPoll;
-
-import java.io.IOException;
-import java.net.URL;
-
-import org.apache.commons.httpclient.HttpException;
-import org.jboss.test.selenium.locator.Attribute;
-import org.jboss.test.selenium.locator.AttributeLocator;
-import org.jboss.test.selenium.locator.JQueryLocator;
-import org.richfaces.tests.metamer.ftest.AbstractMetamerTest;
-import org.richfaces.tests.metamer.ftest.annotations.Inject;
-import org.richfaces.tests.metamer.ftest.annotations.Templates;
-import org.richfaces.tests.metamer.ftest.annotations.Use;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Test;
-
-import static org.jboss.test.selenium.utils.URLUtils.buildUrl;
-import static org.testng.Assert.*;
-import static org.jboss.test.selenium.utils.text.SimplifiedFormat.format;
-import static org.jboss.test.selenium.utils.PrimitiveUtils.*;
-
-/**
- * Tests the a4j:poll component.
- *
- * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
- * @version $Revision$
- */
-public class TestInterval extends AbstractMetamerTest {
-
- private static final int ITERATION_COUNT = 5;
-
- @Inject
- int interval;
-
- IntervalAttributes attributes = new IntervalAttributes();
-
- JQueryLocator time = pjq("span[id$=time]");
- AttributeLocator<?> clientTime = pjq("span[id$=event1:outputTime]").getAttribute(Attribute.TITLE);
-
- long startTime;
-
- long deviationTotal = 0;
- long deviationCount = 0;
-
- @Override
- public URL getTestUrl() {
- return buildUrl(contextPath, "faces/components/a4jPoll/simple.xhtml?enabled=false");
- }
-
- @BeforeMethod
- public void resetDeviations() {
- deviationTotal = 0;
- deviationCount = 0;
- }
-
- @Test
- @Use(field = "interval", ints = { 1000 })
- public void testClientAllTemplates() throws HttpException, IOException {
- testClient();
- }
-
- @Test
- @Use(field = "interval", ints = { 500, 5000 })
- @Templates(value = "plain")
- public void testClientDifferentIntervals() throws HttpException, IOException {
- testClient();
- }
-
- /**
- * <p>
- * Test the progress of polling for 3 different values from client side.
- * </p>
- *
- * <p>
- * It defines the new interval value first for each iteration and then enable polling.
- * </p>
- *
- * <p>
- * Then, it waits for first poll event (zero iteration).
- * </p>
- *
- * <p>
- * For 5 following poll events it checks that runtime visible from client (output from JavaScript's new
- * Date().getTime()) between the events haven't greater deviation from defined interval than defined
- * {@link #MAX_DEVIATION}.
- * </p>
- *
- * <p>
- * Test also computes average value of deviation and checks that the average value of all obtained particular
- * deviations isn't greater than {@link #MAX_AVERAGE_DEVIATION}.
- * </p>
- */
- public void testClient() {
- attributes.setEnabled(true);
- attributes.setInterval(interval);
-
- waitForPoll();
- for (int i = 0; i < ITERATION_COUNT; i++) {
- startInterval();
- waitForPoll();
- validateInterval();
- }
-
- validateAverageDeviation();
- }
-
- private void startInterval() {
- startTime = System.currentTimeMillis();
- }
-
- private void waitForPoll() {
- selenium.getPageExtensions().install();
- selenium.getRequestInterceptor().clearRequestTypeDone();
- selenium.getRequestInterceptor().waitForRequestTypeChange();
- }
-
- private void validateInterval() {
- long runTime = getClientTime() - startTime;
- long deviation = Math.abs(interval - runTime);
-
- if (seleniumDebug) {
- System.out.println(format("deviation for interval {0}: {1}", interval, deviation));
- }
-
- assertTrue(deviation <= (2 * interval),
- format("Deviation ({0}) is greater than two intervals (2 * {1})", deviation, interval));
-
- deviationTotal += deviation;
- deviationCount += 1;
- }
-
- private void validateAverageDeviation() {
- long maximumAvgDeviation = Math.min(interval / 3, 1000);
- long averageDeviation = deviationTotal / deviationCount;
-
- if (seleniumDebug) {
- System.out.println("averageDeviation: " + averageDeviation);
- }
- assertTrue(
- averageDeviation <= maximumAvgDeviation,
- format("Average deviation for all the intervals ({0}) should not be greater than defined maximum {1}",
- averageDeviation, maximumAvgDeviation));
- }
-
- /**
- * Returns the time of poll event (the time when arrived the response from server)
- *
- * @return the time of poll event (the time when arrived the response from server)
- */
- private long getClientTime() {
- return asLong(selenium.getAttribute(clientTime));
- }
-}
Copied: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jPoll/TestPollInterval.java (from rev 21478, modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jPoll/TestInterval.java)
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jPoll/TestPollInterval.java (rev 0)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jPoll/TestPollInterval.java 2011-02-05 14:49:51 UTC (rev 21479)
@@ -0,0 +1,174 @@
+/*******************************************************************************
+ * 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.ftest.a4jPoll;
+
+import java.io.IOException;
+import java.net.URL;
+
+import org.apache.commons.httpclient.HttpException;
+import org.jboss.test.selenium.locator.Attribute;
+import org.jboss.test.selenium.locator.AttributeLocator;
+import org.jboss.test.selenium.locator.JQueryLocator;
+import org.richfaces.tests.metamer.ftest.AbstractMetamerTest;
+import org.richfaces.tests.metamer.ftest.annotations.Inject;
+import org.richfaces.tests.metamer.ftest.annotations.Templates;
+import org.richfaces.tests.metamer.ftest.annotations.Use;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+import static org.jboss.test.selenium.utils.URLUtils.buildUrl;
+import static org.testng.Assert.*;
+import static org.jboss.test.selenium.utils.text.SimplifiedFormat.format;
+import static org.jboss.test.selenium.utils.PrimitiveUtils.*;
+
+/**
+ * Tests the a4j:poll component.
+ *
+ * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
+ * @version $Revision$
+ */
+public class TestPollInterval extends AbstractMetamerTest {
+
+ private static final int ITERATION_COUNT = 5;
+
+ @Inject
+ int interval;
+
+ PollAttributes attributes = new PollAttributes();
+
+ JQueryLocator time = pjq("span[id$=time]");
+ AttributeLocator<?> clientTime = pjq("span[id$=event1:outputTime]").getAttribute(Attribute.TITLE);
+
+ long startTime;
+
+ long deviationTotal = 0;
+ long deviationCount = 0;
+
+ @Override
+ public URL getTestUrl() {
+ return buildUrl(contextPath, "faces/components/a4jPoll/simple.xhtml?enabled=false");
+ }
+
+ @BeforeMethod
+ public void resetDeviations() {
+ deviationTotal = 0;
+ deviationCount = 0;
+ }
+
+ @Test
+ @Use(field = "interval", ints = { 1000 })
+ public void testClientAllTemplates() throws HttpException, IOException {
+ testClient();
+ }
+
+ @Test
+ @Use(field = "interval", ints = { 500, 5000 })
+ @Templates(value = "plain")
+ public void testClientDifferentIntervals() throws HttpException, IOException {
+ testClient();
+ }
+
+ /**
+ * <p>
+ * Test the progress of polling for 3 different values from client side.
+ * </p>
+ *
+ * <p>
+ * It defines the new interval value first for each iteration and then enable polling.
+ * </p>
+ *
+ * <p>
+ * Then, it waits for first poll event (zero iteration).
+ * </p>
+ *
+ * <p>
+ * For 5 following poll events it checks that runtime visible from client (output from JavaScript's new
+ * Date().getTime()) between the events haven't greater deviation from defined interval than defined
+ * {@link #MAX_DEVIATION}.
+ * </p>
+ *
+ * <p>
+ * Test also computes average value of deviation and checks that the average value of all obtained particular
+ * deviations isn't greater than {@link #MAX_AVERAGE_DEVIATION}.
+ * </p>
+ */
+ public void testClient() {
+ attributes.setEnabled(true);
+ attributes.setInterval(interval);
+
+ waitForPoll();
+ for (int i = 0; i < ITERATION_COUNT; i++) {
+ startInterval();
+ waitForPoll();
+ validateInterval();
+ }
+
+ validateAverageDeviation();
+ }
+
+ private void startInterval() {
+ startTime = System.currentTimeMillis();
+ }
+
+ private void waitForPoll() {
+ selenium.getPageExtensions().install();
+ selenium.getRequestInterceptor().clearRequestTypeDone();
+ selenium.getRequestInterceptor().waitForRequestTypeChange();
+ }
+
+ private void validateInterval() {
+ long runTime = getClientTime() - startTime;
+ long deviation = Math.abs(interval - runTime);
+
+ if (seleniumDebug) {
+ System.out.println(format("deviation for interval {0}: {1}", interval, deviation));
+ }
+
+ assertTrue(deviation <= (2 * interval),
+ format("Deviation ({0}) is greater than two intervals (2 * {1})", deviation, interval));
+
+ deviationTotal += deviation;
+ deviationCount += 1;
+ }
+
+ private void validateAverageDeviation() {
+ long maximumAvgDeviation = Math.min(interval / 3, 1000);
+ long averageDeviation = deviationTotal / deviationCount;
+
+ if (seleniumDebug) {
+ System.out.println("averageDeviation: " + averageDeviation);
+ }
+ assertTrue(
+ averageDeviation <= maximumAvgDeviation,
+ format("Average deviation for all the intervals ({0}) should not be greater than defined maximum {1}",
+ averageDeviation, maximumAvgDeviation));
+ }
+
+ /**
+ * Returns the time of poll event (the time when arrived the response from server)
+ *
+ * @return the time of poll event (the time when arrived the response from server)
+ */
+ private long getClientTime() {
+ return asLong(selenium.getAttribute(clientTime));
+ }
+}
Added: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jPoll/TestPollSimple.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jPoll/TestPollSimple.java (rev 0)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jPoll/TestPollSimple.java 2011-02-05 14:49:51 UTC (rev 21479)
@@ -0,0 +1,194 @@
+/*******************************************************************************
+ * 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.ftest.a4jPoll;
+
+import static javax.faces.event.PhaseId.ANY_PHASE;
+import static javax.faces.event.PhaseId.APPLY_REQUEST_VALUES;
+import static javax.faces.event.PhaseId.INVOKE_APPLICATION;
+import static javax.faces.event.PhaseId.PROCESS_VALIDATIONS;
+import static javax.faces.event.PhaseId.RENDER_RESPONSE;
+import static javax.faces.event.PhaseId.RESTORE_VIEW;
+import static javax.faces.event.PhaseId.UPDATE_MODEL_VALUES;
+import static org.jboss.test.selenium.utils.URLUtils.buildUrl;
+import static org.testng.Assert.assertEquals;
+import static org.testng.Assert.assertFalse;
+import static org.testng.Assert.assertTrue;
+
+import java.net.URL;
+
+import org.jboss.test.selenium.locator.JQueryLocator;
+import org.richfaces.tests.metamer.ftest.AbstractMetamerTest;
+import org.richfaces.tests.metamer.ftest.annotations.Inject;
+import org.richfaces.tests.metamer.ftest.annotations.Use;
+import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.Test;
+
+/**
+ * @author <a href="mailto:lfryc@redhat.com">Lukas Fryc</a>
+ * @version $Revision$
+ */
+public class TestPollSimple extends AbstractMetamerTest {
+
+ PollAttributes attributes = new PollAttributes();
+
+ JQueryLocator outputCounter = pjq("span[id$=outputCounter]");
+
+ @Inject
+ @Use(empty = true)
+ String event;
+ String[] events = new String[] { "timer", "begin", "beforedomupdate", "complete" };
+
+ @Override
+ public URL getTestUrl() {
+ return buildUrl(contextPath, "faces/components/a4jPoll/simple.xhtml");
+ }
+
+ @BeforeMethod
+ public void enablePoll() {
+ attributes.setInterval(2500);
+ attributes.setEnabled(true);
+
+ }
+
+ @Test
+ public void testAction() {
+ waitForTwoSubsequentRequests();
+ phaseInfo.assertListener(INVOKE_APPLICATION, "action invoked");
+ phaseInfo.assertPhases(ANY_PHASE);
+ }
+
+ @Test
+ public void testActionListener() {
+ waitForTwoSubsequentRequests();
+ phaseInfo.assertListener(INVOKE_APPLICATION, "action listener invoked");
+ phaseInfo.assertPhases(ANY_PHASE);
+ }
+
+ @Test
+ public void testBypassUpdates() {
+ attributes.setBypassUpdates(true);
+ waitForTwoSubsequentRequests();
+ phaseInfo.assertListener(PROCESS_VALIDATIONS, "action invoked");
+ phaseInfo.assertPhases(RESTORE_VIEW, APPLY_REQUEST_VALUES, PROCESS_VALIDATIONS, RENDER_RESPONSE);
+ }
+
+ @Test
+ public void testData() {
+ attributes.setData("RichFaces 4");
+ attributes.setOncomplete("data = event.data");
+
+ retrieveRequestTime.initializeValue();
+ waitGui.waitForChange(retrieveRequestTime);
+
+ assertEquals(retrieveWindowData.retrieve(), "RichFaces 4");
+ }
+
+ @Test
+ public void testImmediate() {
+ attributes.setImmediate(true);
+ waitForTwoSubsequentRequests();
+ phaseInfo.assertListener(APPLY_REQUEST_VALUES, "action invoked");
+ phaseInfo.assertPhases(RESTORE_VIEW, APPLY_REQUEST_VALUES, RENDER_RESPONSE);
+ }
+
+ @Test
+ @Use(field = "event", value = "events")
+ public void testClientSideEvent() {
+ testClientSideEventHandlers(event);
+ }
+
+ @Test
+ public void testClientSideEventsOrder() {
+ testClientSideEventHandlers(events);
+ }
+
+ @Test
+ public void testRendered() {
+ attributes.setEnabled(true);
+ attributes.setRendered(false);
+
+ retrieveRequestTime.initializeValue();
+ waitModel.timeout(5000).interval(1000).waitForTimeout();
+ assertFalse(retrieveRequestTime.isValueChanged());
+
+ attributes.setRendered(true);
+ waitForTwoSubsequentRequests();
+ }
+
+ @Test
+ public void testExecute() {
+ attributes.setExecute("executeChecker");
+
+ waitForTwoSubsequentRequests();
+
+ phaseInfo.assertListener(UPDATE_MODEL_VALUES, "executeChecker");
+ }
+
+ @Test
+ public void testEnabled() {
+ attributes.setEnabled(false);
+
+ retrieveRequestTime.initializeValue();
+ waitModel.timeout(5000).interval(1000).waitForTimeout();
+ assertFalse(retrieveRequestTime.isValueChanged());
+
+ attributes.setEnabled(true);
+ waitForTwoSubsequentRequests();
+ }
+
+ @Test
+ public void testRender() {
+ attributes.setRender("renderChecker");
+ retrieveRenderChecker.initializeValue();
+ retrieveRequestTime.initializeValue();
+ waitAjax.waitForChange(retrieveRenderChecker);
+ assertTrue(retrieveRequestTime.isValueChanged());
+ }
+
+ @Test
+ public void testLimitRender() {
+ attributes.setLimitRender(true);
+ attributes.setRender("renderChecker");
+ retrieveRenderChecker.initializeValue();
+ retrieveRequestTime.initializeValue();
+ waitGui.waitForChange(retrieveRenderChecker);
+ assertFalse(retrieveRequestTime.isValueChanged());
+ }
+
+ private void testClientSideEventHandlers(String... events) {
+ attributes.setEnabled(false);
+ super.testRequestEventsBefore(events);
+ retrieveRequestTime.initializeValue();
+ attributes.setEnabled(true);
+
+ waitAjax.waitForChange(retrieveRequestTime);
+
+ super.testRequestEventsAfter(events);
+ }
+
+ private void waitForTwoSubsequentRequests() {
+ retrieveRequestTime.initializeValue();
+
+ waitAjax.waitForChange(retrieveRequestTime);
+ waitAjax.waitForChange(retrieveRequestTime);
+ }
+}
15 years, 2 months
JBoss Rich Faces SVN: r21478 - modules/tests/metamer/trunk/application/src/main/webapp/components/a4jPoll.
by richfaces-svn-commits@lists.jboss.org
Author: lfryc(a)redhat.com
Date: 2011-02-05 09:48:44 -0500 (Sat, 05 Feb 2011)
New Revision: 21478
Modified:
modules/tests/metamer/trunk/application/src/main/webapp/components/a4jPoll/simple.xhtml
Log:
fixed rendering on a4j:poll sample (RF-10360, RF-10359)
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/a4jPoll/simple.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/a4jPoll/simple.xhtml 2011-02-05 00:06:07 UTC (rev 21477)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/a4jPoll/simple.xhtml 2011-02-05 14:48:44 UTC (rev 21478)
@@ -58,12 +58,11 @@
onbegin="#{rich:element('timeWatcher:grid')}.begin(); #{a4jPollBean.attributes['onbegin'].value}"
oncomplete="#{rich:element('timeWatcher:grid')}.complete(); #{a4jPollBean.attributes['oncomplete'].value}"
ontimer="#{rich:element('timeWatcher:grid')}.event(); #{rich:element('timeWatcher:grid')}.difference(); #{a4jPollBean.attributes['ontimer'].value}"
- render="#{a4jPollBean.attributes['render'].value}"
+ render="#{a4jPollBean.attributes['render'].value} output"
rendered="#{a4jPollBean.attributes['rendered'].value}"
status="#{a4jPollBean.attributes['status'].value}"
value="#{a4jPollBean.attributes['value'].value}"
>
- <a4j:ajax event="timer" render="output" />
</a4j:poll>
</h:panelGroup>
15 years, 2 months
JBoss Rich Faces SVN: r21477 - trunk/examples/richfaces-showcase/src/main/webapp/richfaces/dataTable/samples.
by richfaces-svn-commits@lists.jboss.org
Author: alexsmirnov
Date: 2011-02-04 19:06:07 -0500 (Fri, 04 Feb 2011)
New Revision: 21477
Modified:
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/dataTable/samples/dataTableEdit-sample.xhtml
Log:
OPEN - issue RF-10293: richfaces-showcase: message: not updated via ajax but h:message + outputPanel does.
https://issues.jboss.org/browse/RF-10293
Modified: trunk/examples/richfaces-showcase/src/main/webapp/richfaces/dataTable/samples/dataTableEdit-sample.xhtml
===================================================================
--- trunk/examples/richfaces-showcase/src/main/webapp/richfaces/dataTable/samples/dataTableEdit-sample.xhtml 2011-02-04 23:59:32 UTC (rev 21476)
+++ trunk/examples/richfaces-showcase/src/main/webapp/richfaces/dataTable/samples/dataTableEdit-sample.xhtml 2011-02-05 00:06:07 UTC (rev 21477)
@@ -92,21 +92,21 @@
<h:inputText value="#{carsBean.editedCar.price}" required="true"
requiredMessage="Price is required" id="price"
validatorMessage="Should be a valid price" label="Price field" />
- <rich:message for="price" ajaxRendered="true"/>
+ <rich:message id="priceMsg" for="price" ajaxRendered="true"/>
<h:outputText value="Mileage" />
<h:inputText value="#{carsBean.editedCar.mileage}" id="mage"
validatorMessage="Should be a valid mileage" label="Mileage field" />
- <rich:message for="mage" ajaxRendered="true"/>
+ <rich:message id="madeMsg" for="mage" ajaxRendered="true"/>
<h:outputText value="VIN" />
<h:inputText value="#{carsBean.editedCar.vin}" id="vin"
required="true" validatorMessage="Not a valid 17-digit VIN"
requiredMessage="VIN is required">
<f:validateLength minimum="17" maximum="17" />
</h:inputText>
- <rich:message for="vin" ajaxRendered="true"/>
+ <rich:message id="vinMsg" for="vin" ajaxRendered="true"/>
</h:panelGrid>
<a4j:commandButton value="Store" action="#{carsBean.store}"
- render="table" execute="@form"
+ render="#{facesContext.maximumSeverity==null?'table':'priceMsg,vinMsg,madeMsg'}" execute="@form"
oncomplete="if (#{facesContext.maximumSeverity==null}) {#{rich:component('editPane')}.hide();}" />
<a4j:commandButton value="Cancel"
onclick="#{rich:component('editPane')}.hide(); return false;" />
15 years, 2 months
JBoss Rich Faces SVN: r21476 - in trunk: ui/validator/ui/src/main/config and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: alexsmirnov
Date: 2011-02-04 18:59:32 -0500 (Fri, 04 Feb 2011)
New Revision: 21476
Added:
trunk/ui/validator/ui/src/main/java/org/richfaces/component/AbstractMessage.java
trunk/ui/validator/ui/src/main/java/org/richfaces/component/AbstractMessages.java
trunk/ui/validator/ui/src/main/java/org/richfaces/component/ClientSideMessage.java
Removed:
trunk/ui/validator/ui/src/main/config/messages.xml
trunk/ui/validator/ui/src/main/java/org/richfaces/component/UIAjaxValidator.java
trunk/ui/validator/ui/src/main/java/org/richfaces/component/UIRichMessages.java
Modified:
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/dataTable/samples/dataTableEdit-sample.xhtml
trunk/ui/validator/ui/src/main/java/org/richfaces/component/behavior/ClientValidatorImpl.java
Log:
CODING IN PROGRESS - issue RF-10293: richfaces-showcase: message: not updated via ajax but h:message + outputPanel does.
https://issues.jboss.org/browse/RF-10293
Modified: trunk/examples/richfaces-showcase/src/main/webapp/richfaces/dataTable/samples/dataTableEdit-sample.xhtml
===================================================================
--- trunk/examples/richfaces-showcase/src/main/webapp/richfaces/dataTable/samples/dataTableEdit-sample.xhtml 2011-02-04 23:03:36 UTC (rev 21475)
+++ trunk/examples/richfaces-showcase/src/main/webapp/richfaces/dataTable/samples/dataTableEdit-sample.xhtml 2011-02-04 23:59:32 UTC (rev 21476)
@@ -92,18 +92,18 @@
<h:inputText value="#{carsBean.editedCar.price}" required="true"
requiredMessage="Price is required" id="price"
validatorMessage="Should be a valid price" label="Price field" />
- <rich:message for="price" />
+ <rich:message for="price" ajaxRendered="true"/>
<h:outputText value="Mileage" />
<h:inputText value="#{carsBean.editedCar.mileage}" id="mage"
validatorMessage="Should be a valid mileage" label="Mileage field" />
- <rich:message for="mage" />
+ <rich:message for="mage" ajaxRendered="true"/>
<h:outputText value="VIN" />
<h:inputText value="#{carsBean.editedCar.vin}" id="vin"
required="true" validatorMessage="Not a valid 17-digit VIN"
requiredMessage="VIN is required">
<f:validateLength minimum="17" maximum="17" />
</h:inputText>
- <rich:message for="vin" />
+ <rich:message for="vin" ajaxRendered="true"/>
</h:panelGrid>
<a4j:commandButton value="Store" action="#{carsBean.store}"
render="table" execute="@form"
Deleted: trunk/ui/validator/ui/src/main/config/messages.xml
===================================================================
--- trunk/ui/validator/ui/src/main/config/messages.xml 2011-02-04 23:03:36 UTC (rev 21475)
+++ trunk/ui/validator/ui/src/main/config/messages.xml 2011-02-04 23:59:32 UTC (rev 21476)
@@ -1,34 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<faces-config version="2.0" metadata-complete="false"
- xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd"
- xmlns="http://java.sun.com/xml/ns/javaee" xmlns:cdk="http://jboss.org/schema/richfaces/cdk/extensions"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <component>
- <component-type>org.richfaces.Message</component-type>
- <component-class>org.richfaces.component.html.HtmlMessage</component-class>
- <component-extension>
- <cdk:generate>true</cdk:generate>
- <cdk:base-class>javax.faces.component.UIMessage</cdk:base-class>
- <cdk:component-family>javax.faces.Message</cdk:component-family>
- <cdk:renderer-type>org.richfaces.MessageRenderer</cdk:renderer-type>
- <cdk:tag>
- <cdk:tag-name>message</cdk:tag-name>
- <cdk:tag-type>Facelets</cdk:tag-type>
- </cdk:tag>
- </component-extension>
- </component>
- <component>
- <component-type>org.richfaces.Messages</component-type>
- <component-class>org.richfaces.component.html.HtmlMessages</component-class>
- <component-extension>
- <cdk:generate>true</cdk:generate>
- <cdk:base-class>javax.faces.component.UIMessages</cdk:base-class>
- <cdk:component-family>javax.faces.Messages</cdk:component-family>
- <cdk:renderer-type>org.richfaces.MessagesRenderer</cdk:renderer-type>
- <cdk:tag>
- <cdk:tag-name>messages</cdk:tag-name>
- <cdk:tag-type>Facelets</cdk:tag-type>
- </cdk:tag>
- </component-extension>
- </component>
-</faces-config>
Added: trunk/ui/validator/ui/src/main/java/org/richfaces/component/AbstractMessage.java
===================================================================
--- trunk/ui/validator/ui/src/main/java/org/richfaces/component/AbstractMessage.java (rev 0)
+++ trunk/ui/validator/ui/src/main/java/org/richfaces/component/AbstractMessage.java 2011-02-04 23:59:32 UTC (rev 21476)
@@ -0,0 +1,62 @@
+/*
+ * $Id$
+ * 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.component;
+
+import javax.faces.component.UIMessage;
+
+import org.ajax4jsf.component.AjaxOutput;
+import org.richfaces.cdk.annotations.Attribute;
+import org.richfaces.cdk.annotations.JsfComponent;
+import org.richfaces.cdk.annotations.JsfRenderer;
+import org.richfaces.cdk.annotations.RendererSpecificComponent;
+import org.richfaces.cdk.annotations.Tag;
+
+/**
+ * <p class="changed_added_4_0">
+ * </p>
+ *
+ * @author asmirnov(a)exadel.com
+ *
+ */
+@JsfComponent(
+ generate="org.richfaces.component.UIRichMessage",
+ type="org.richfaces.Message",
+ components=@RendererSpecificComponent(
+ tag=@Tag(name="message"),
+ generate="org.richfaces.component.html.HtmlMessage",
+ attributes={"core-props.xml","events-props.xml","i18n-props.xml"},
+ renderer=@JsfRenderer(template="/message.template.xml")
+ )
+ )
+public abstract class AbstractMessage extends UIMessage implements AjaxOutput {
+
+ @Attribute
+ public abstract boolean isAjaxRendered();
+
+ @Attribute
+ public abstract boolean isKeepTransient();
+
+
+
+}
Property changes on: trunk/ui/validator/ui/src/main/java/org/richfaces/component/AbstractMessage.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: trunk/ui/validator/ui/src/main/java/org/richfaces/component/AbstractMessages.java (from rev 21459, trunk/ui/validator/ui/src/main/java/org/richfaces/component/UIRichMessages.java)
===================================================================
--- trunk/ui/validator/ui/src/main/java/org/richfaces/component/AbstractMessages.java (rev 0)
+++ trunk/ui/validator/ui/src/main/java/org/richfaces/component/AbstractMessages.java 2011-02-04 23:59:32 UTC (rev 21476)
@@ -0,0 +1,70 @@
+/*
+ * $Id$
+ * 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.component;
+
+import javax.faces.component.UIMessages;
+import javax.faces.context.FacesContext;
+
+import org.ajax4jsf.component.AjaxOutput;
+import org.richfaces.cdk.annotations.Attribute;
+import org.richfaces.cdk.annotations.JsfComponent;
+import org.richfaces.cdk.annotations.JsfRenderer;
+import org.richfaces.cdk.annotations.RendererSpecificComponent;
+import org.richfaces.cdk.annotations.Tag;
+
+/**
+ * <p class="changed_added_4_0">
+ * </p>
+ *
+ * @author asmirnov(a)exadel.com
+ *
+ */
+@JsfComponent(
+ generate="org.richfaces.component.UIRichMessages",
+ type="org.richfaces.Messages",
+ components=@RendererSpecificComponent(
+ tag=@Tag(name="messages"),
+ generate="org.richfaces.component.html.HtmlMessages",
+ attributes={"core-props.xml","events-props.xml","i18n-props.xml"},
+ renderer=@JsfRenderer(template="/messages.template.xml")
+ )
+ )
+public abstract class AbstractMessages extends UIMessages implements AjaxOutput, ClientSideMessage {
+
+ @Attribute
+ public abstract boolean isAjaxRendered();
+
+ @Attribute
+ public abstract boolean isKeepTransient();
+
+
+ /* (non-Javadoc)
+ * @see org.richfaces.component.ClientSideMessage#updateMessages(javax.faces.context.FacesContext, java.lang.String)
+ */
+ public void updateMessages(FacesContext context, String clientId) {
+ // TODO Auto-generated method stub
+
+ }
+
+}
Added: trunk/ui/validator/ui/src/main/java/org/richfaces/component/ClientSideMessage.java
===================================================================
--- trunk/ui/validator/ui/src/main/java/org/richfaces/component/ClientSideMessage.java (rev 0)
+++ trunk/ui/validator/ui/src/main/java/org/richfaces/component/ClientSideMessage.java 2011-02-04 23:59:32 UTC (rev 21476)
@@ -0,0 +1,11 @@
+package org.richfaces.component;
+
+import javax.faces.context.FacesContext;
+
+public interface ClientSideMessage {
+
+ void updateMessages(FacesContext context, String clientId);
+
+ String getFor();
+
+}
\ No newline at end of file
Property changes on: trunk/ui/validator/ui/src/main/java/org/richfaces/component/ClientSideMessage.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Deleted: trunk/ui/validator/ui/src/main/java/org/richfaces/component/UIAjaxValidator.java
===================================================================
--- trunk/ui/validator/ui/src/main/java/org/richfaces/component/UIAjaxValidator.java 2011-02-04 23:03:36 UTC (rev 21475)
+++ trunk/ui/validator/ui/src/main/java/org/richfaces/component/UIAjaxValidator.java 2011-02-04 23:59:32 UTC (rev 21476)
@@ -1,204 +0,0 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library 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 library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.richfaces.component;
-
-import java.io.IOException;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Set;
-
-import javax.faces.FacesException;
-import javax.faces.component.EditableValueHolder;
-import javax.faces.component.NamingContainer;
-import javax.faces.component.UIComponent;
-import javax.faces.component.UIComponentBase;
-import javax.faces.component.UIInput;
-import javax.faces.component.UIMessage;
-import javax.faces.component.UIMessages;
-import javax.faces.context.FacesContext;
-import javax.faces.event.AbortProcessingException;
-import javax.faces.event.FacesEvent;
-import javax.faces.event.PhaseId;
-
-import org.richfaces.event.ValidatorEvent;
-
-/**
- * JSF component class
- *
- */
-public abstract class UIAjaxValidator extends UIComponentBase implements AjaxContainer {
-
- public static final String COMPONENT_TYPE = "org.richfaces.AjaxValidator";
-
- public static final String COMPONENT_FAMILY = "org.richfaces.AjaxValidator";
-
- public static final String BEAN_VALIDATOR_FACET = "org.richfaces.validator.";
-
- @Override
- public void setParent(UIComponent parent) {
- super.setParent(parent);
-
- if (null != parent && parent instanceof EditableValueHolder) {
- setParentProperties(parent);
- }
- }
-
- public abstract String getOnsubmit();
-
- /**
- * @param parent
- * @throws FacesException
- */
- public void setParentProperties(UIComponent parent) throws FacesException {
- if (!(parent instanceof EditableValueHolder)) {
- throw new FacesException("Parent component must be an EditableValueHolder");
- }
-
- // if (null != getEvent()) {
- // ValueExpression binding = new EventValueExpression(this);
- // parent.setValueExpression(getEvent(), binding);
- // }
- }
-
- @Override
- public void broadcast(FacesEvent event) throws AbortProcessingException {
- super.broadcast(event);
- if (event.getComponent() == this) {
- FacesContext context = getFacesContext();
- if (event instanceof ValidatorEvent) {
- // ByPass UpdateModelValue
- context.renderResponse();
- }
- }
- }
-
- @Override
- public void queueEvent(FacesEvent event) {
- if (event instanceof ValidatorEvent && event.getComponent() == this) {
- UIComponent parent = getParent();
- if (parent instanceof UIInput) {
- UIInput input = (UIInput) parent;
- if (input.isImmediate()) {
- event.setPhaseId(PhaseId.APPLY_REQUEST_VALUES);
- } else {
- event.setPhaseId(PhaseId.PROCESS_VALIDATIONS);
- }
- }
- }
- super.queueEvent(event);
- }
-
- public String getEventString() {
- StringBuffer buildOnEvent = new StringBuffer();
- String onsubmit = getOnsubmit();
- // Insert script to call before submit ajax request.
- if (null != onsubmit) {
- buildOnEvent.append(onsubmit).append(";");
- }
- // buildOnEvent.append(AjaxRendererUtils.buildOnEvent(this,
- // getFacesContext(), getEvent(), true));
- String script = buildOnEvent.toString();
- return script;
- }
-
- public UIComponent getSingleComponent() {
- return getParent();
- }
-
- public void encodeAjax(FacesContext context) throws IOException {
-// AjaxContext ajaxContext = AjaxContext.getCurrentInstance(context);
-// Set<String> renderedAreas = ajaxContext.getAjaxRenderedAreas();
-// for (UIComponent message : getMessages(context, this)) {
-// if (message.isRendered()) {
-// message.encodeAll(context);
-// renderedAreas.add(message.getClientId(context));
-// }
-// }
- // Write information about encoded areas after submission.
- // AjaxRendererUtils.encodeAreas(context, this);
- }
-
- public Set<UIComponent> getMessages(FacesContext context, UIComponent component) {
- Set<UIComponent> messages = new HashSet<UIComponent>();
- findMessages(component.getParent(), component, messages, false);
- findRichMessages(context, context.getViewRoot(), messages);
- return messages;
- }
-
- /**
- * Find all instances of the {@link UIRichMessages} and update list of the rendered messages.
- *
- * @param context
- * @param component
- * @param messages
- */
- protected void findRichMessages(FacesContext context, UIComponent component, Set<UIComponent> messages) {
- Iterator<UIComponent> facetsAndChildren = component.getFacetsAndChildren();
- while (facetsAndChildren.hasNext()) {
- UIComponent child = (UIComponent) facetsAndChildren.next();
- if (child instanceof UIRichMessages) {
- UIRichMessages richMessage = (UIRichMessages) child;
- if (null == richMessage.getFor()) {
- richMessage.updateMessages(context, this.getParent().getClientId(context));
- messages.add(richMessage);
- }
- } else {
- findRichMessages(context, child, messages);
- }
- }
- }
-
- /**
- * Recursive search messages for the parent component.
- *
- * @param parent
- * @param component
- * @param messages
- * @return
- */
- protected boolean findMessages(UIComponent parent, UIComponent component, Set<UIComponent> messages, boolean found) {
- Iterator<UIComponent> facetsAndChildren = parent.getFacetsAndChildren();
- while (facetsAndChildren.hasNext()) {
- UIComponent child = (UIComponent) facetsAndChildren.next();
- if (child != component) {
- if (child instanceof UIMessage || child instanceof UIMessages) {
- UIComponent message = (UIComponent) child;
- Object targetId = message.getAttributes().get("for");
- if (null != targetId && targetId.equals(getParent().getId())) {
- messages.add(message);
- found = true;
- }
- } else {
- found |= findMessages(child, null, messages, found);
- }
- }
- }
- if (!(found && parent instanceof NamingContainer) && component != null) {
- UIComponent newParent = parent.getParent();
- if (null != newParent) {
- found = findMessages(newParent, parent, messages, found);
- }
- }
- return found;
- }
-
-}
Deleted: trunk/ui/validator/ui/src/main/java/org/richfaces/component/UIRichMessages.java
===================================================================
--- trunk/ui/validator/ui/src/main/java/org/richfaces/component/UIRichMessages.java 2011-02-04 23:03:36 UTC (rev 21475)
+++ trunk/ui/validator/ui/src/main/java/org/richfaces/component/UIRichMessages.java 2011-02-04 23:59:32 UTC (rev 21476)
@@ -1,43 +0,0 @@
-/*
- * $Id$
- * 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.component;
-
-import javax.faces.component.UIMessages;
-import javax.faces.context.FacesContext;
-
-/**
- * <p class="changed_added_4_0">
- * </p>
- *
- * @author asmirnov(a)exadel.com
- *
- */
-public class UIRichMessages extends UIMessages {
-
- public void updateMessages(FacesContext context, String clientId) {
- // TODO Auto-generated method stub
-
- }
-
-}
Modified: trunk/ui/validator/ui/src/main/java/org/richfaces/component/behavior/ClientValidatorImpl.java
===================================================================
--- trunk/ui/validator/ui/src/main/java/org/richfaces/component/behavior/ClientValidatorImpl.java 2011-02-04 23:03:36 UTC (rev 21475)
+++ trunk/ui/validator/ui/src/main/java/org/richfaces/component/behavior/ClientValidatorImpl.java 2011-02-04 23:59:32 UTC (rev 21476)
@@ -23,6 +23,7 @@
package org.richfaces.component.behavior;
import java.util.Collection;
+import java.util.Collections;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;
@@ -52,7 +53,7 @@
import org.richfaces.cdk.annotations.JsfBehavior;
import org.richfaces.cdk.annotations.Tag;
import org.richfaces.cdk.annotations.TagType;
-import org.richfaces.component.UIRichMessages;
+import org.richfaces.component.ClientSideMessage;
import org.richfaces.log.Logger;
import org.richfaces.log.RichfacesLogger;
import org.richfaces.renderkit.html.ClientValidatorRenderer;
@@ -77,6 +78,10 @@
public class ClientValidatorImpl extends AjaxBehavior implements ClientValidatorBehavior {
+ private static final Set<String> NONE = Collections.singleton("@none");
+
+ private static final Set<String> THIS = Collections.singleton("@this");
+
private static final Class<?>[] EMPTY_GROUPS = new Class<?>[0];
private static final String VALUE = "value";
@@ -141,11 +146,11 @@
Iterator<UIComponent> facetsAndChildren = component.getFacetsAndChildren();
while (facetsAndChildren.hasNext()) {
UIComponent child = (UIComponent) facetsAndChildren.next();
- if (child instanceof UIRichMessages) {
- UIRichMessages richMessage = (UIRichMessages) child;
+ if (child instanceof ClientSideMessage) {
+ ClientSideMessage richMessage = (ClientSideMessage) child;
if (null == richMessage.getFor()) {
richMessage.updateMessages(context, id);
- messages.add(richMessage);
+ messages.add(child);
}
} else {
findRichMessages(context, child, id, messages);
@@ -374,4 +379,24 @@
return false;
}
+ // Disable processing for any component except validated input.
+ @Override
+ public boolean isLimitRender() {
+ return true;
+ }
+
+ @Override
+ public boolean isBypassUpdates() {
+ return true;
+ }
+
+ @Override
+ public Collection<String> getExecute() {
+ return THIS;
+ }
+
+ @Override
+ public Collection<String> getRender() {
+ return NONE;
+ }
}
15 years, 2 months
JBoss Rich Faces SVN: r21475 - trunk/core/impl/src/main/resources/META-INF/resources.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2011-02-04 18:03:36 -0500 (Fri, 04 Feb 2011)
New Revision: 21475
Modified:
trunk/core/impl/src/main/resources/META-INF/resources/skinning.ecss
trunk/core/impl/src/main/resources/META-INF/resources/skinning_classes.ecss
Log:
https://issues.jboss.org/browse/RF-8675
Modified: trunk/core/impl/src/main/resources/META-INF/resources/skinning.ecss
===================================================================
--- trunk/core/impl/src/main/resources/META-INF/resources/skinning.ecss 2011-02-04 22:33:02 UTC (rev 21474)
+++ trunk/core/impl/src/main/resources/META-INF/resources/skinning.ecss 2011-02-04 23:03:36 UTC (rev 21475)
@@ -48,11 +48,18 @@
background-image: "url(#{resource['org.richfaces.renderkit.html.images.ButtonBackgroundImage']})";
}
+button:hover, input[type="reset"]:hover, input[type="submit"]:hover, input[type="button"]:hover {
+ background-position: bottom left;
+ background-repeat: repeat-x;
+ background-image: "url(#{resource['org.richfaces.renderkit.html.images.ButtonHoverBackgroundImage']})";
+}
+
button[disabled], input[type="reset"][disabled], input[type="submit"][disabled], input[type="button"][disabled] {
color: '#{richSkin.tabDisabledTextColor}';
border-color: '#{richSkin.tableFooterBackgroundColor}';
background-color: '#{richSkin.tableFooterBackgroundColor}';
background-image: "url(#{resource['org.richfaces.renderkit.html.images.ButtonDisabledBackgroundImage']})";
+ background-position: top left;
}
textarea, input[type="text"], input[type="password"], select {
Modified: trunk/core/impl/src/main/resources/META-INF/resources/skinning_classes.ecss
===================================================================
--- trunk/core/impl/src/main/resources/META-INF/resources/skinning_classes.ecss 2011-02-04 22:33:02 UTC (rev 21474)
+++ trunk/core/impl/src/main/resources/META-INF/resources/skinning_classes.ecss 2011-02-04 23:03:36 UTC (rev 21475)
@@ -344,17 +344,30 @@
color:'#{richSkin.headerTextColor}';
}
+.rfs-ctn button:hover, .rfs-btn:hover,
+.rfs-btn-btn:hover,
+.rfs-btn-reset:hover,
+.rfs-btn-submit:hover,
+.rfs-ctn input[type="reset"]:hover, .rfs-input-reset:hover,
+.rfs-ctn input[type="submit"]:hover, .rfs-input-submit:hover,
+.rfs-ctn input[type="button"]:hover, .rfs-input-btn:hover {
+ background-position: bottom left;
+ background-repeat: repeat-x;
+ background-image: "url(#{resource['org.richfaces.renderkit.html.images.ButtonHoverBackgroundImage']})";
+}
+
.rfs-ctn button[disabled], .rfs-btn-disabled,
-.rfs-btn-btn-disabled,
-.rfs-btn-reset-disabled,
-.rfs-btn-submit-disabled,
-.rfs-ctn input[type="reset"][disabled], .rfs-input-reset-disabled,
-.rfs-ctn input[type="submit"][disabled], .rfs-input-submit-disabled,
-.rfs-ctn input[type="button"][disabled], .rfs-input-btn-disabled {
- color:'#{richSkin.tabDisabledTextColor}';
- background-color:'#{richSkin.tableFooterBackgroundColor}';
- border-color:'#{richSkin.tableFooterBackgroundColor}';
- background-image:"url(#{resource['org.richfaces.renderkit.html.images.ButtonDisabledBackgroundImage']})";
+.rfs-btn-btn[disabled], .rfs-btn-btn-disabled,
+.rfs-btn-reset[disabled], .rfs-btn-reset-disabled,
+.rfs-btn-submit[disabled], .rfs-btn-submit-disabled,
+.rfs-ctn input[type="reset"][disabled], .rfs-input-reset[disabled], .rfs-input-reset-disabled,
+.rfs-ctn input[type="submit"][disabled], .rfs-input-submit[disabled], .rfs-input-submit-disabled,
+.rfs-ctn input[type="button"][disabled], .rfs-input-btn[disabled], .rfs-input-btn-disabled {
+ color: '#{richSkin.tabDisabledTextColor}';
+ background-color: '#{richSkin.tableFooterBackgroundColor}';
+ border-color: '#{richSkin.tableFooterBackgroundColor}';
+ background-image: "url(#{resource['org.richfaces.renderkit.html.images.ButtonDisabledBackgroundImage']})";
+ background-position: top left;
}
15 years, 2 months
JBoss Rich Faces SVN: r21474 - in trunk/core: impl/src/main/java/org/richfaces/context and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2011-02-04 17:33:02 -0500 (Fri, 04 Feb 2011)
New Revision: 21474
Modified:
trunk/core/api/src/main/java/org/richfaces/renderkit/AjaxConstants.java
trunk/core/impl/src/main/java/org/richfaces/context/ComponentCallback.java
trunk/core/impl/src/main/java/org/richfaces/context/ExecuteComponentCallback.java
trunk/core/impl/src/main/java/org/richfaces/context/RenderComponentCallback.java
Log:
https://issues.jboss.org/browse/RF-10429
Modified: trunk/core/api/src/main/java/org/richfaces/renderkit/AjaxConstants.java
===================================================================
--- trunk/core/api/src/main/java/org/richfaces/renderkit/AjaxConstants.java 2011-02-04 20:37:34 UTC (rev 21473)
+++ trunk/core/api/src/main/java/org/richfaces/renderkit/AjaxConstants.java 2011-02-04 22:33:02 UTC (rev 21474)
@@ -21,6 +21,7 @@
*/
package org.richfaces.renderkit;
+
/**
* @author Nick Belaevski
*
@@ -30,7 +31,6 @@
public static final String ALL = "@all";
public static final String FORM = "@form";
public static final String THIS = "@this";
- public static final String REGION = "@region";
public static final String NONE = "@none";
public static final String BEHAVIOR_EVENT_PARAMETER = "javax.faces.behavior.event";
Modified: trunk/core/impl/src/main/java/org/richfaces/context/ComponentCallback.java
===================================================================
--- trunk/core/impl/src/main/java/org/richfaces/context/ComponentCallback.java 2011-02-04 20:37:34 UTC (rev 21473)
+++ trunk/core/impl/src/main/java/org/richfaces/context/ComponentCallback.java 2011-02-04 22:33:02 UTC (rev 21474)
@@ -35,7 +35,6 @@
import org.ajax4jsf.component.AjaxClientBehavior;
import org.richfaces.renderkit.util.CoreAjaxRendererUtils;
-import org.richfaces.renderkit.util.CoreRendererUtils;
/**
* User: akolonitsky
@@ -77,19 +76,14 @@
return null;
}
- protected Collection<String> resolveComponents(Object value, UIComponent target, String defaultValue) {
+ protected Collection<String> toCollection(Object value) {
//TODO - unit tests check for "@none" element
- Collection<String> ids = CoreAjaxRendererUtils.asIdsSet(value);
- if (ids == null) {
- ids = new LinkedHashSet<String>(1);
+ Collection<String> result = CoreAjaxRendererUtils.asIdsSet(value);
+ if (result == null) {
+ result = new LinkedHashSet<String>(1);
}
- if (ids.isEmpty() && defaultValue != null) {
- // asSet() returns copy of original set and we're free to modify it
- ids.add(defaultValue);
- }
-
- return CoreRendererUtils.INSTANCE.findComponentsFor(facesContext, target, ids);
+ return result;
}
protected abstract void doVisit(UIComponent target, AjaxClientBehavior behavior);
Modified: trunk/core/impl/src/main/java/org/richfaces/context/ExecuteComponentCallback.java
===================================================================
--- trunk/core/impl/src/main/java/org/richfaces/context/ExecuteComponentCallback.java 2011-02-04 20:37:34 UTC (rev 21473)
+++ trunk/core/impl/src/main/java/org/richfaces/context/ExecuteComponentCallback.java 2011-02-04 22:33:02 UTC (rev 21474)
@@ -29,6 +29,8 @@
import org.ajax4jsf.component.AjaxClientBehavior;
import org.richfaces.component.AjaxContainer;
+import org.richfaces.renderkit.AjaxConstants;
+import org.richfaces.renderkit.util.CoreRendererUtils;
/**
* @author akolonitsky
@@ -53,7 +55,15 @@
value = target.getAttributes().get("execute");
}
- executeIds = resolveComponents(value, target, AjaxContainer.META_CLIENT_ID);
+ Collection<String> unresolvedExecuteIds = toCollection(value);
+ //toCollection() returns copy of original set and we're free to modify it
+ if (unresolvedExecuteIds.isEmpty()) {
+ unresolvedExecuteIds.add(AjaxContainer.META_CLIENT_ID);
+ } else if (!unresolvedExecuteIds.contains(AjaxContainer.META_CLIENT_ID)) {
+ unresolvedExecuteIds.add(AjaxConstants.THIS);
+ }
+
+ executeIds = CoreRendererUtils.INSTANCE.findComponentsFor(facesContext, target, unresolvedExecuteIds);
}
public Collection<String> getExecuteIds() {
Modified: trunk/core/impl/src/main/java/org/richfaces/context/RenderComponentCallback.java
===================================================================
--- trunk/core/impl/src/main/java/org/richfaces/context/RenderComponentCallback.java 2011-02-04 20:37:34 UTC (rev 21473)
+++ trunk/core/impl/src/main/java/org/richfaces/context/RenderComponentCallback.java 2011-02-04 22:33:02 UTC (rev 21474)
@@ -29,6 +29,7 @@
import org.ajax4jsf.component.AjaxClientBehavior;
import org.richfaces.renderkit.util.CoreAjaxRendererUtils;
+import org.richfaces.renderkit.util.CoreRendererUtils;
/**
* @author akolonitsky
@@ -87,7 +88,9 @@
data = CoreAjaxRendererUtils.getAjaxData(target);
}
- renderIds = resolveComponents(renderValue, target, null);
+ Collection<String> unresolvedRenderIds = toCollection(renderValue);
+ //NB: toCollection() returns copy of original set and we're free to modify it - not used here
+ renderIds = CoreRendererUtils.INSTANCE.findComponentsFor(facesContext, target, unresolvedRenderIds);
}
}
15 years, 2 months