JBoss Rich Faces SVN: r21703 - in modules/tests/metamer/trunk: ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richSelect and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: ppitonak(a)redhat.com
Date: 2011-02-16 10:58:24 -0500 (Wed, 16 Feb 2011)
New Revision: 21703
Added:
modules/tests/metamer/trunk/application/src/main/webapp/components/richSelect/fAjax.xhtml
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richSelect/TestRichSelectFAjax.java
Modified:
modules/tests/metamer/trunk/application/src/main/webapp/components/richSelect/list.xhtml
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richSelect/TestRichSelect.java
Log:
added sample and test for rich:select+f:ajax
Added: modules/tests/metamer/trunk/application/src/main/webapp/components/richSelect/fAjax.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richSelect/fAjax.xhtml (rev 0)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richSelect/fAjax.xhtml 2011-02-16 15:58:24 UTC (rev 21703)
@@ -0,0 +1,105 @@
+<?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:metamer="http://java.sun.com/jsf/composite/metamer"
+ xmlns:rich="http://richfaces.org/rich" xmlns:a4j="http://richfaces.org/a4j">
+
+ <!--
+JBoss, Home of Professional Open Source
+Copyright 2010-2011, 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>
+ </ui:define>
+
+ <ui:define name="outOfTemplateBefore">
+ </ui:define>
+
+ <ui:define name="component">
+ <rich:select id="select"
+ converterMessage="#{richSelectBean.attributes['converterMessage'].value}"
+ defaultLabel="#{richSelectBean.attributes['defaultLabel'].value}"
+ disabled="#{richSelectBean.attributes['disabled'].value}"
+ enableManualInput="#{richSelectBean.attributes['enableManualInput'].value}"
+ immediate="#{richSelectBean.attributes['immediate'].value}"
+ itemClass="#{richSelectBean.attributes['itemClass'].value}"
+ listClass="#{richSelectBean.attributes['listClass'].value}"
+ listHeight="#{richSelectBean.attributes['listHeight'].value}"
+ listWidth="#{richSelectBean.attributes['listWidth'].value}"
+ maxListHeight="#{richSelectBean.attributes['maxListHeight'].value}"
+ minListHeight="#{richSelectBean.attributes['minListHeight'].value}"
+ onblur="#{richSelectBean.attributes['onblur'].value}"
+ onchange="#{richSelectBean.attributes['onchange'].value}"
+ onclick="#{richSelectBean.attributes['onclick'].value}"
+ ondblclick="#{richSelectBean.attributes['ondblclick'].value}"
+ onfocus="#{richSelectBean.attributes['onfocus'].value}"
+ onkeydown="#{richSelectBean.attributes['onkeydown'].value}"
+ onkeypress="#{richSelectBean.attributes['onkeypress'].value}"
+ onkeyup="#{richSelectBean.attributes['onkeyup'].value}"
+ onlistclick="#{richSelectBean.attributes['onlistclick'].value}"
+ onlistdblclick="#{richSelectBean.attributes['onlistdblclick'].value}"
+ onlistkeydown="#{richSelectBean.attributes['onlistkeydown'].value}"
+ onlistkeypress="#{richSelectBean.attributes['onlistkeypress'].value}"
+ onlistkeyup="#{richSelectBean.attributes['onlistkeyup'].value}"
+ onlistmousedown="#{richSelectBean.attributes['onlistmousedown'].value}"
+ onlistmousemove="#{richSelectBean.attributes['onlistmousemove'].value}"
+ onlistmouseout="#{richSelectBean.attributes['onlistmouseout'].value}"
+ onlistmouseover="#{richSelectBean.attributes['onlistmouseover'].value}"
+ onlistmouseup="#{richSelectBean.attributes['onlistmouseup'].value}"
+ onmousedown="#{richSelectBean.attributes['onmousedown'].value}"
+ onmousemove="#{richSelectBean.attributes['onmousemove'].value}"
+ onmouseout="#{richSelectBean.attributes['onmouseout'].value}"
+ onmouseover="#{richSelectBean.attributes['onmouseover'].value}"
+ onmouseup="#{richSelectBean.attributes['onmouseup'].value}"
+ onselectitem="#{richSelectBean.attributes['onselectitem'].value}"
+ rendered="#{richSelectBean.attributes['rendered'].value}"
+ required="#{richSelectBean.attributes['required'].value}"
+ requiredMessage="#{richSelectBean.attributes['requiredMessage'].value}"
+ selectFirst="#{richSelectBean.attributes['selectFirst'].value}"
+ selectItemClass="#{richSelectBean.attributes['selectItemClass'].value}"
+ showButton="#{richSelectBean.attributes['showButton'].value}"
+ validatorMessage="#{richSelectBean.attributes['validatorMessage'].value}"
+ value="#{richSelectBean.attributes['value'].value}"
+ valueChangeListener="#{richSelectBean.listener}"
+ >
+
+ <f:selectItems value="#{richSelectBean.capitalsOptions}" />
+ <f:ajax event="change" render="output :phasesPanel"/>
+
+ </rich:select>
+
+ <br/><br/>
+
+ output: <h:outputText id="output" value="#{richSelectBean.attributes['value'].value}"/>
+ </ui:define>
+
+ <ui:define name="outOfTemplateAfter">
+ <metamer:attributes value="#{richSelectBean.attributes}" id="attributes" />
+ </ui:define>
+
+ </ui:composition>
+</html>
\ No newline at end of file
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/richSelect/list.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richSelect/list.xhtml 2011-02-16 15:57:39 UTC (rev 21702)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richSelect/list.xhtml 2011-02-16 15:58:24 UTC (rev 21703)
@@ -32,9 +32,13 @@
<ui:define name="links">
<metamer:testPageLink id="simple" outcome="simple" value="Simple">
- Simple page that contains <b>rich:select</b> and input boxes for all its attributes.
+ Simple page that contains <b>rich:select</b> with a4j:ajax and input boxes for all its attributes.
</metamer:testPageLink>
+ <metamer:testPageLink id="fAjax" outcome="fAjax" value="f:ajax">
+ Simple page that contains <b>rich:select</b> with f:ajax and input boxes for all its attributes.
+ </metamer:testPageLink>
+
</ui:define>
</ui:composition>
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richSelect/TestRichSelect.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richSelect/TestRichSelect.java 2011-02-16 15:57:39 UTC (rev 21702)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richSelect/TestRichSelect.java 2011-02-16 15:58:24 UTC (rev 21703)
@@ -94,6 +94,7 @@
assertTrue(selenium.belongsClass(options.format(10), "rf-sel-sel"));
waitGui.failWith("Bean was not updated").until(textEquals.locator(output).text("Hawaii"));
+ phaseInfo.assertListener(PhaseId.PROCESS_VALIDATIONS, "value changed: null -> Hawaii");
}
@Test
@@ -120,6 +121,7 @@
// assertTrue(selenium.belongsClass(options.format(10), "rf-sel-sel"));
//
// waitGui.failWith("Bean was not updated").until(textEquals.locator(output).text("Hawaii"));
+// phaseInfo.assertListener(PhaseId.PROCESS_VALIDATIONS, "value changed: null -> Hawaii");
}
@Test
Added: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richSelect/TestRichSelectFAjax.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richSelect/TestRichSelectFAjax.java (rev 0)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richSelect/TestRichSelectFAjax.java 2011-02-16 15:58:24 UTC (rev 21703)
@@ -0,0 +1,81 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010-2011, 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.richSelect;
+
+import static org.jboss.test.selenium.guard.request.RequestTypeGuardFactory.guardNoRequest;
+import static org.jboss.test.selenium.guard.request.RequestTypeGuardFactory.guardXhr;
+import static org.jboss.test.selenium.locator.LocatorFactory.jq;
+import static org.jboss.test.selenium.utils.URLUtils.buildUrl;
+import static org.testng.Assert.assertEquals;
+import static org.testng.Assert.assertTrue;
+
+import java.net.URL;
+
+import javax.faces.event.PhaseId;
+
+import org.jboss.test.selenium.dom.Event;
+import org.jboss.test.selenium.locator.JQueryLocator;
+import org.richfaces.tests.metamer.ftest.AbstractMetamerTest;
+import org.testng.annotations.Test;
+
+/**
+ * Test case for page faces/components/richSelect/fAjax.xhtml.
+ *
+ * @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
+ * @version $Revision$
+ */
+public class TestRichSelectFAjax extends AbstractMetamerTest {
+
+ private JQueryLocator input = pjq("input.rf-sel-inp[id$=selectInput]");
+ private JQueryLocator popup = jq("div.rf-sel-lst-cord");
+ private JQueryLocator options = jq("div.rf-sel-opt:eq({0})"); // 00..49
+ private JQueryLocator button = pjq("span.rf-sel-btn");
+ private JQueryLocator output = pjq("span[id$=output]");
+
+ @Override
+ public URL getTestUrl() {
+ return buildUrl(contextPath, "faces/components/richSelect/fAjax.xhtml");
+ }
+
+ @Test
+ public void testSelectWithMouse() {
+ guardNoRequest(selenium).mouseDown(button);
+ selenium.mouseUp(button);
+ assertTrue(selenium.isVisible(popup), "Popup should be displayed.");
+
+ for (int i = 0; i < 50; i++) {
+ assertTrue(selenium.isDisplayed(options.format(i)), "Select option " + i + " should be displayed.");
+ }
+
+ String[] selectOptions = {"Alabama", "Hawaii", "Massachusetts", "New Mexico", "South Dakota"};
+ for (int i = 0; i < 50; i += 10) {
+ assertEquals(selenium.getText(options.format(i)), selectOptions[i / 10], "Select option nr. " + i);
+ }
+
+ guardNoRequest(selenium).click(options.format(10));
+ guardXhr(selenium).fireEvent(input, Event.BLUR);
+ assertTrue(selenium.belongsClass(options.format(10), "rf-sel-sel"));
+
+ waitGui.failWith("Bean was not updated").until(textEquals.locator(output).text("Hawaii"));
+ phaseInfo.assertListener(PhaseId.PROCESS_VALIDATIONS, "value changed: null -> Hawaii");
+ }
+}
15 years, 2 months
JBoss Rich Faces SVN: r21702 - in modules/tests/metamer/trunk: ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInplaceSelect and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: ppitonak(a)redhat.com
Date: 2011-02-16 10:57:39 -0500 (Wed, 16 Feb 2011)
New Revision: 21702
Added:
modules/tests/metamer/trunk/application/src/main/webapp/components/richInplaceSelect/fAjax.xhtml
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInplaceSelect/TestRichInplaceSelectFAjax.java
Modified:
modules/tests/metamer/trunk/application/src/main/webapp/components/richInplaceSelect/list.xhtml
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInplaceSelect/TestRichInplaceSelect.java
Log:
added sample + test for rich:inplaceSelect+f:ajax
Added: modules/tests/metamer/trunk/application/src/main/webapp/components/richInplaceSelect/fAjax.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richInplaceSelect/fAjax.xhtml (rev 0)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richInplaceSelect/fAjax.xhtml 2011-02-16 15:57:39 UTC (rev 21702)
@@ -0,0 +1,124 @@
+<?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:metamer="http://java.sun.com/jsf/composite/metamer"
+ xmlns:rich="http://richfaces.org/rich" >
+
+ <!--
+JBoss, Home of Professional Open Source
+Copyright 2010-2011, 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>
+ </ui:define>
+
+ <ui:define name="outOfTemplateBefore">
+ </ui:define>
+
+ <ui:define name="component">
+ <rich:inplaceSelect id="inplaceSelect"
+ changedStateClass="#{richInplaceSelectBean.attributes['changedStateClass'].value}"
+ converterMessage="#{richInplaceSelectBean.attributes['converterMessage'].value}"
+ defaultLabel="#{richInplaceSelectBean.attributes['defaultLabel'].value}"
+ disabled="#{richInplaceSelectBean.attributes['disabled'].value}"
+ disabledStateClass="#{richInplaceSelectBean.attributes['disabledStateClass'].value}"
+ editEvent="#{richInplaceSelectBean.attributes['editEvent'].value}"
+ editStateClass="#{richInplaceSelectBean.attributes['editStateClass'].value}"
+ immediate="#{richInplaceSelectBean.attributes['immediate'].value}"
+ inputWidth="#{richInplaceSelectBean.attributes['inputWidth'].value}"
+ itemClass="#{richInplaceSelectBean.attributes['itemClass'].value}"
+ listClass="#{richInplaceSelectBean.attributes['listClass'].value}"
+ listHeight="#{richInplaceSelectBean.attributes['listHeight'].value}"
+ listWidth="#{richInplaceSelectBean.attributes['listWidth'].value}"
+ onblur="#{richInplaceSelectBean.attributes['onblur'].value}"
+ onchange="#{richInplaceSelectBean.attributes['onchange'].value}"
+ onclick="#{richInplaceSelectBean.attributes['onclick'].value}"
+ ondblclick="#{richInplaceSelectBean.attributes['ondblclick'].value}"
+ onfocus="#{richInplaceSelectBean.attributes['onfocus'].value}"
+ oninputclick="#{richInplaceSelectBean.attributes['oninputclick'].value}"
+ oninputdblclick="#{richInplaceSelectBean.attributes['oninputdblclick'].value}"
+ oninputkeydown="#{richInplaceSelectBean.attributes['oninputkeydown'].value}"
+ oninputkeypress="#{richInplaceSelectBean.attributes['oninputkeypress'].value}"
+ oninputkeyup="#{richInplaceSelectBean.attributes['oninputkeyup'].value}"
+ oninputmousedown="#{richInplaceSelectBean.attributes['oninputmousedown'].value}"
+ oninputmousemove="#{richInplaceSelectBean.attributes['oninputmousemove'].value}"
+ oninputmouseout="#{richInplaceSelectBean.attributes['oninputmouseout'].value}"
+ oninputmouseover="#{richInplaceSelectBean.attributes['oninputmouseover'].value}"
+ oninputmouseup="#{richInplaceSelectBean.attributes['oninputmouseup'].value}"
+ oninputselect="#{richInplaceSelectBean.attributes['oninputselect'].value}"
+ onkeydown="#{richInplaceSelectBean.attributes['onkeydown'].value}"
+ onkeypress="#{richInplaceSelectBean.attributes['onkeypress'].value}"
+ onkeyup="#{richInplaceSelectBean.attributes['onkeyup'].value}"
+ onlistclick="#{richInplaceSelectBean.attributes['onlistclick'].value}"
+ onlistdblclick="#{richInplaceSelectBean.attributes['onlistdblclick'].value}"
+ onlistkeydown="#{richInplaceSelectBean.attributes['onlistkeydown'].value}"
+ onlistkeypress="#{richInplaceSelectBean.attributes['onlistkeypress'].value}"
+ onlistkeyup="#{richInplaceSelectBean.attributes['onlistkeyup'].value}"
+ onlistmousedown="#{richInplaceSelectBean.attributes['onlistmousedown'].value}"
+ onlistmousemove="#{richInplaceSelectBean.attributes['onlistmousemove'].value}"
+ onlistmouseout="#{richInplaceSelectBean.attributes['onlistmouseout'].value}"
+ onlistmouseover="#{richInplaceSelectBean.attributes['onlistmouseover'].value}"
+ onlistmouseup="#{richInplaceSelectBean.attributes['onlistmouseup'].value}"
+ onmousedown="#{richInplaceSelectBean.attributes['onmousedown'].value}"
+ onmousemove="#{richInplaceSelectBean.attributes['onmousemove'].value}"
+ onmouseout="#{richInplaceSelectBean.attributes['onmouseout'].value}"
+ onmouseover="#{richInplaceSelectBean.attributes['onmouseover'].value}"
+ onmouseup="#{richInplaceSelectBean.attributes['onmouseup'].value}"
+ onselectitem="#{richInplaceSelectBean.attributes['onselectitem'].value}"
+ openOnEdit="#{richInplaceSelectBean.attributes['openOnEdit'].value}"
+ readyStateClass="#{richInplaceSelectBean.attributes['readyStateClass'].value}"
+ rendered="#{richInplaceSelectBean.attributes['rendered'].value}"
+ required="#{richInplaceSelectBean.attributes['required'].value}"
+ requiredMessage="#{richInplaceSelectBean.attributes['requiredMessage'].value}"
+ saveOnBlur="#{richInplaceSelectBean.attributes['saveOnBlur'].value}"
+ saveOnSelect="#{richInplaceSelectBean.attributes['saveOnSelect'].value}"
+ selectItemClass="#{richInplaceSelectBean.attributes['selectItemClass'].value}"
+ showControls="#{richInplaceSelectBean.attributes['showControls'].value}"
+ style="#{richInplaceSelectBean.attributes['style'].value}"
+ tabindex="#{richInplaceSelectBean.attributes['tabindex'].value}"
+ validatorMessage="#{richInplaceSelectBean.attributes['validatorMessage'].value}"
+ value="#{richInplaceSelectBean.attributes['value'].value}"
+ valueChangeListener="#{richInplaceSelectBean.listener}"
+ >
+
+ <f:selectItems value="#{richInplaceSelectBean.capitalsOptions}" />
+
+ <f:ajax event="change" render="output :phasesPanel"/>
+
+ </rich:inplaceSelect>
+
+ <br/><br/>
+
+ output: <h:outputText id="output" value="#{richInplaceSelectBean.attributes['value'].value}"/>
+ </ui:define>
+
+ <ui:define name="outOfTemplateAfter">
+ <metamer:attributes value="#{richInplaceSelectBean.attributes}" id="attributes" />
+ </ui:define>
+
+ </ui:composition>
+</html>
\ No newline at end of file
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/richInplaceSelect/list.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richInplaceSelect/list.xhtml 2011-02-16 15:56:50 UTC (rev 21701)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richInplaceSelect/list.xhtml 2011-02-16 15:57:39 UTC (rev 21702)
@@ -32,9 +32,13 @@
<ui:define name="links">
<metamer:testPageLink id="simple" outcome="simple" value="Simple">
- Simple page that contains <b>rich:inplaceSelect</b> and input boxes for all its attributes.
+ Simple page that contains <b>rich:inplaceSelect</b> with a4j:ajax and input boxes for all its attributes.
</metamer:testPageLink>
+ <metamer:testPageLink id="fAjax" outcome="fAjax" value="f:ajax">
+ Simple page that contains <b>rich:inplaceSelect</b> with f:ajax and input boxes for all its attributes.
+ </metamer:testPageLink>
+
</ui:define>
</ui:composition>
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInplaceSelect/TestRichInplaceSelect.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInplaceSelect/TestRichInplaceSelect.java 2011-02-16 15:56:50 UTC (rev 21701)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInplaceSelect/TestRichInplaceSelect.java 2011-02-16 15:57:39 UTC (rev 21702)
@@ -100,8 +100,7 @@
assertEquals(selenium.getText(label), "Hawaii", "Label should contain selected value.");
- String listenerText = selenium.getText(jq("div#phasesPanel li:eq(3)"));
- assertEquals(listenerText, "* value changed: null -> Hawaii", "Value change listener was not invoked.");
+ phaseInfo.assertListener(PhaseId.PROCESS_VALIDATIONS, "value changed: null -> Hawaii");
}
@Test
Added: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInplaceSelect/TestRichInplaceSelectFAjax.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInplaceSelect/TestRichInplaceSelectFAjax.java (rev 0)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInplaceSelect/TestRichInplaceSelectFAjax.java 2011-02-16 15:57:39 UTC (rev 21702)
@@ -0,0 +1,90 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010-2011, 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.richInplaceSelect;
+
+import static org.jboss.test.selenium.locator.LocatorFactory.jq;
+import static org.jboss.test.selenium.guard.request.RequestTypeGuardFactory.guardNoRequest;
+import static org.jboss.test.selenium.guard.request.RequestTypeGuardFactory.guardXhr;
+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 javax.faces.event.PhaseId;
+
+import org.jboss.test.selenium.dom.Event;
+import org.jboss.test.selenium.locator.JQueryLocator;
+import org.richfaces.tests.metamer.ftest.AbstractMetamerTest;
+import org.richfaces.tests.metamer.ftest.annotations.IssueTracking;
+import org.testng.annotations.Test;
+
+/**
+ * Test case for page faces/components/richInplaceSelect/fAjax.xhtml.
+ *
+ * @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
+ * @version $Revision$
+ */
+public class TestRichInplaceSelectFAjax extends AbstractMetamerTest {
+
+ private JQueryLocator select = pjq("span[id$=inplaceSelect]");
+ private JQueryLocator label = pjq("span.rf-is-lbl");
+ private JQueryLocator input = pjq("input[id$=inplaceSelectInput]");
+ private JQueryLocator popup = pjq("span.rf-is-lst-cord");
+ private JQueryLocator edit = pjq("span.rf-is-edit");
+ private JQueryLocator options = jq("span.rf-is-opt:eq({0})"); // 00..49
+ private JQueryLocator output = pjq("span[id$=output]");
+
+ @Override
+ public URL getTestUrl() {
+ return buildUrl(contextPath, "faces/components/richInplaceSelect/fAjax.xhtml");
+ }
+
+ @Test
+ @IssueTracking("https://issues.jboss.org/browse/RF-10538")
+ public void testClick() {
+ guardNoRequest(selenium).click(select);
+ assertFalse(selenium.belongsClass(edit, "rf-is-none"), "Edit should not contain class rf-is-none when popup is open.");
+ assertTrue(selenium.isDisplayed(popup), "Popup should be displayed.");
+
+ for (int i = 0; i < 50; i++) {
+ assertTrue(selenium.isDisplayed(options.format(i)), "Select option " + i + " should be displayed.");
+ }
+
+ String[] selectOptions = {"Alabama", "Hawaii", "Massachusetts", "New Mexico", "South Dakota"};
+ for (int i = 0; i < 50; i += 10) {
+ assertEquals(selenium.getText(options.format(i)), selectOptions[i / 10], "Select option nr. " + i);
+ }
+
+ selenium.click(options.format(10));
+ guardXhr(selenium).fireEvent(input, Event.BLUR);
+ waitGui.failWith("Output did not change.").until(textEquals.locator(output).text("Hawaii"));
+
+ assertTrue(selenium.belongsClass(select, "rf-is-c-s"), "New class should be added to inplace select.");
+ assertTrue(selenium.belongsClass(edit, "rf-is-none"), "Edit should contain class rf-is-none when popup is closed.");
+
+ assertEquals(selenium.getText(label), "Hawaii", "Label should contain selected value.");
+
+ phaseInfo.assertListener(PhaseId.PROCESS_VALIDATIONS, "value changed: null -> Hawaii");
+ }
+}
15 years, 2 months
JBoss Rich Faces SVN: r21701 - in modules/tests/metamer/trunk: ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInplaceInput and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: ppitonak(a)redhat.com
Date: 2011-02-16 10:56:50 -0500 (Wed, 16 Feb 2011)
New Revision: 21701
Added:
modules/tests/metamer/trunk/application/src/main/webapp/components/richInplaceInput/fAjax.xhtml
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInplaceInput/TestRichInplaceInputFAjax.java
Modified:
modules/tests/metamer/trunk/application/src/main/webapp/components/richInplaceInput/list.xhtml
Log:
added new sample and test for rich:inplaceInput+f:ajax
Added: modules/tests/metamer/trunk/application/src/main/webapp/components/richInplaceInput/fAjax.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richInplaceInput/fAjax.xhtml (rev 0)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richInplaceInput/fAjax.xhtml 2011-02-16 15:56:50 UTC (rev 21701)
@@ -0,0 +1,107 @@
+<?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:metamer="http://java.sun.com/jsf/composite/metamer"
+ xmlns:rich="http://richfaces.org/rich" >
+
+ <!--
+JBoss, Home of Professional Open Source
+Copyright 2010-2011, 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>
+ </ui:define>
+
+ <ui:define name="outOfTemplateBefore">
+ </ui:define>
+
+ <ui:define name="component">
+ <rich:inplaceInput id="inplaceInput"
+ changedStateClass="#{richInplaceInputBean.attributes['changedStateClass'].value}"
+ converter="#{richInplaceInputBean.attributes['converter'].value}"
+ converterMessage="#{richInplaceInputBean.attributes['converterMessage'].value}"
+ defaultLabel="#{richInplaceInputBean.attributes['defaultLabel'].value}"
+ disabled="#{richInplaceInputBean.attributes['disabled'].value}"
+ disabledStateClass="#{richInplaceInputBean.attributes['disabledStateClass'].value}"
+ editClass="#{richInplaceInputBean.attributes['editClass'].value}"
+ editEvent="#{richInplaceInputBean.attributes['editEvent'].value}"
+ editStateClass="#{richInplaceInputBean.attributes['editStateClass'].value}"
+ immediate="#{richInplaceInputBean.attributes['immediate'].value}"
+ inputWidth="#{richInplaceInputBean.attributes['inputWidth'].value}"
+ noneClass="#{richInplaceInputBean.attributes['noneClass'].value}"
+ onblur="#{richInplaceInputBean.attributes['onblur'].value}"
+ onclick="#{richInplaceInputBean.attributes['onclick'].value}"
+ onchange="#{richInplaceInputBean.attributes['onchange'].value}"
+ ondblclick="#{richInplaceInputBean.attributes['ondblclick'].value}"
+ onfocus="#{richInplaceInputBean.attributes['onfocus'].value}"
+ oninputclick="#{richInplaceInputBean.attributes['oninputclick'].value}"
+ oninputdblclick="#{richInplaceInputBean.attributes['oninputdblclick'].value}"
+ oninputkeydown="#{richInplaceInputBean.attributes['oninputkeydown'].value}"
+ oninputkeypress="#{richInplaceInputBean.attributes['oninputkeypress'].value}"
+ oninputkeyup="#{richInplaceInputBean.attributes['oninputkeyup'].value}"
+ oninputmousedown="#{richInplaceInputBean.attributes['oninputmousedown'].value}"
+ oninputmousemove="#{richInplaceInputBean.attributes['oninputmousemove'].value}"
+ oninputmouseout="#{richInplaceInputBean.attributes['oninputmouseout'].value}"
+ oninputmouseover="#{richInplaceInputBean.attributes['oninputmouseover'].value}"
+ oninputmouseup="#{richInplaceInputBean.attributes['oninputmouseup'].value}"
+ oninputselect="#{richInplaceInputBean.attributes['oninputselect'].value}"
+ onkeydown="#{richInplaceInputBean.attributes['onkeydown'].value}"
+ onkeypress="#{richInplaceInputBean.attributes['onkeypress'].value}"
+ onkeyup="#{richInplaceInputBean.attributes['onkeyup'].value}"
+ onmousedown="#{richInplaceInputBean.attributes['onmousedown'].value}"
+ onmousemove="#{richInplaceInputBean.attributes['onmousemove'].value}"
+ onmouseout="#{richInplaceInputBean.attributes['onmouseout'].value}"
+ onmouseover="#{richInplaceInputBean.attributes['onmouseover'].value}"
+ onmouseup="#{richInplaceInputBean.attributes['onmouseup'].value}"
+ readyStateClass="#{richInplaceInputBean.attributes['readyStateClass'].value}"
+ rendered="#{richInplaceInputBean.attributes['rendered'].value}"
+ required="#{richInplaceInputBean.attributes['required'].value}"
+ requiredMessage="#{richInplaceInputBean.attributes['requiredMessage'].value}"
+ saveOnBlur="#{richInplaceInputBean.attributes['saveOnBlur'].value}"
+ showControls="#{richInplaceInputBean.attributes['showControls'].value}"
+ style="#{richInplaceInputBean.attributes['style'].value}"
+ tabindex="#{richInplaceInputBean.attributes['tabindex'].value}"
+ validatorMessage="#{richInplaceInputBean.attributes['validatorMessage'].value}"
+ value="#{richInplaceInputBean.attributes['value'].value}"
+ valueChangeListener="#{richBean.valueChangeListener}"
+ >
+
+ <f:ajax event="change" render="output :phasesPanel"/>
+
+ </rich:inplaceInput>
+
+ <br/><br/>
+
+ output: <h:outputText id="output" value="#{richInplaceInputBean.attributes['value'].value}"/>
+ </ui:define>
+
+ <ui:define name="outOfTemplateAfter">
+ <metamer:attributes value="#{richInplaceInputBean.attributes}" id="attributes" />
+ </ui:define>
+
+ </ui:composition>
+</html>
\ No newline at end of file
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/richInplaceInput/list.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richInplaceInput/list.xhtml 2011-02-16 15:52:15 UTC (rev 21700)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richInplaceInput/list.xhtml 2011-02-16 15:56:50 UTC (rev 21701)
@@ -32,9 +32,13 @@
<ui:define name="links">
<metamer:testPageLink id="simple" outcome="simple" value="Simple">
- Simple page that contains <b>rich:inplaceInput</b> and input boxes for all its attributes.
+ Simple page that contains <b>rich:inplaceInput</b> with a4j:ajax and input boxes for all its attributes.
</metamer:testPageLink>
+ <metamer:testPageLink id="fAjax" outcome="fAjax" value="f:ajax">
+ Simple page that contains <b>rich:inplaceInput</b> with f:ajax and input boxes for all its attributes.
+ </metamer:testPageLink>
+
</ui:define>
</ui:composition>
Added: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInplaceInput/TestRichInplaceInputFAjax.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInplaceInput/TestRichInplaceInputFAjax.java (rev 0)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInplaceInput/TestRichInplaceInputFAjax.java 2011-02-16 15:56:50 UTC (rev 21701)
@@ -0,0 +1,89 @@
+/*******************************************************************************
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010-2011, 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.richInplaceInput;
+
+import static org.jboss.test.selenium.guard.request.RequestTypeGuardFactory.guardNoRequest;
+import static org.jboss.test.selenium.guard.request.RequestTypeGuardFactory.guardXhr;
+import static org.jboss.test.selenium.locator.LocatorFactory.jq;
+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 javax.faces.event.PhaseId;
+
+import org.jboss.test.selenium.css.CssProperty;
+import org.jboss.test.selenium.dom.Event;
+import org.jboss.test.selenium.locator.Attribute;
+import org.jboss.test.selenium.locator.AttributeLocator;
+import org.jboss.test.selenium.locator.JQueryLocator;
+import org.jboss.test.selenium.waiting.EventFiredCondition;
+import org.richfaces.tests.metamer.ftest.AbstractMetamerTest;
+import org.richfaces.tests.metamer.ftest.annotations.IssueTracking;
+import org.richfaces.tests.metamer.ftest.annotations.RegressionTest;
+import org.testng.annotations.Test;
+
+/**
+ * Test case for page faces/components/richInplaceInput/fAjax.xhtml.
+ *
+ * @author <a href="mailto:ppitonak@redhat.com">Pavol Pitonak</a>
+ * @version $Revision$
+ */
+public class TestRichInplaceInputFAjax extends AbstractMetamerTest {
+
+ private JQueryLocator inplaceInput = pjq("span[id$=inplaceInput]");
+ private JQueryLocator label = pjq("span.rf-ii-lbl");
+ private JQueryLocator input = pjq("input[id$=inplaceInputInput]");
+ private JQueryLocator edit = pjq("span.rf-ii-edit");
+ private JQueryLocator okButton = pjq("input.rf-ii-btn[id$=Okbtn]");
+ private JQueryLocator cancelButton = pjq("input.rf-ii-btn[id$=Cancelbtn]");
+ private JQueryLocator output = pjq("span[id$=output]");
+
+ @Override
+ public URL getTestUrl() {
+ return buildUrl(contextPath, "faces/components/richInplaceInput/fAjax.xhtml");
+ }
+
+ @Test
+ public void testClick() {
+ guardNoRequest(selenium).click(inplaceInput);
+ assertFalse(selenium.belongsClass(edit, "rf-ii-none"), "Edit should not contain class rf-is-none when popup is open.");
+ assertTrue(selenium.isDisplayed(input), "Input should be displayed.");
+
+ selenium.type(input, "new value");
+ selenium.fireEvent(input, Event.BLUR);
+ assertTrue(selenium.belongsClass(inplaceInput, "rf-ii-c-s"), "New class should be added to inplace input.");
+ assertTrue(selenium.belongsClass(edit, "rf-ii-none"), "Edit should contain class rf-is-none when popup is closed.");
+
+ assertEquals(selenium.getText(label), "new value", "Label should contain selected value.");
+ assertEquals(selenium.getText(output), "new value", "Output did not change.");
+
+ String listenerText = selenium.getText(jq("div#phasesPanel li:eq(3)"));
+ assertEquals(listenerText, "* value changed: RichFaces 4 -> new value", "Value change listener was not invoked.");
+
+ phaseInfo.assertPhases(PhaseId.RESTORE_VIEW, PhaseId.APPLY_REQUEST_VALUES, PhaseId.PROCESS_VALIDATIONS,
+ PhaseId.UPDATE_MODEL_VALUES, PhaseId.INVOKE_APPLICATION, PhaseId.RENDER_RESPONSE);
+ phaseInfo.assertListener(PhaseId.PROCESS_VALIDATIONS, "value changed: RichFaces 4 -> new value");
+ }
+}
15 years, 2 months
JBoss Rich Faces SVN: r21700 - in modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer: bean and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: lfryc(a)redhat.com
Date: 2011-02-16 10:52:15 -0500 (Wed, 16 Feb 2011)
New Revision: 21700
Modified:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/ColumnSortingMap.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichCollapsibleSubTableBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichColumnBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichDataTableBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichExtendedDataTableBean.java
Log:
made beans serialized to allow them work in MyFaces (RFPL-1134)
Modified: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/ColumnSortingMap.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/ColumnSortingMap.java 2011-02-16 15:51:36 UTC (rev 21699)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/ColumnSortingMap.java 2011-02-16 15:52:15 UTC (rev 21700)
@@ -1,5 +1,6 @@
package org.richfaces.tests.metamer;
+import java.io.Serializable;
import java.util.Collection;
import java.util.TreeMap;
@@ -23,7 +24,9 @@
protected abstract Attributes getAttributes();
- public class ColumnSorting {
+ public class ColumnSorting implements Serializable {
+ private static final long serialVersionUID = 1L;
+
private String columnName;
private SortOrder order = SortOrder.unsorted;
Modified: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichCollapsibleSubTableBean.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichCollapsibleSubTableBean.java 2011-02-16 15:51:36 UTC (rev 21699)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichCollapsibleSubTableBean.java 2011-02-16 15:52:15 UTC (rev 21700)
@@ -56,7 +56,7 @@
// FIXME: @ManagedProperty(value = "#{model.employees}")
private List<Employee> employees = Model.unmarshallEmployees();
private List<List<Employee>> lists;
- private UICollapsibleSubTable binding;
+ private transient UICollapsibleSubTable binding;
// true = model, false = empty table
private boolean state;
Modified: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichColumnBean.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichColumnBean.java 2011-02-16 15:51:36 UTC (rev 21699)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichColumnBean.java 2011-02-16 15:52:15 UTC (rev 21700)
@@ -60,14 +60,8 @@
private String stateNameToFilter;
private SortOrder sortOrder = SortOrder.ascending;
- private final Filter<Capital> stateFilter = new Filter<Capital>() {
+ private Filter<Capital> stateFilter = new StateFilter();
- @Override
- public boolean accept(Capital c) {
- return c.getState().toLowerCase().contains(stateNameToFilter == null ? "" : stateNameToFilter.toLowerCase());
- }
- };
-
/**
* Initializes the managed bean.
*/
@@ -106,24 +100,33 @@
public Filter<Capital> getStateNameFilter() {
return stateFilter;
}
-
+
public String getStateNameToFilter() {
return stateNameToFilter;
}
-
+
public void setStateNameToFilter(String stateNameToFilter) {
this.stateNameToFilter = stateNameToFilter;
}
-
+
public SortOrder[] getSortOrders() {
return SortOrder.values();
}
-
+
public void setSortOrder(SortOrder sortOrder) {
this.sortOrder = sortOrder;
}
-
+
public SortOrder getSortOrder() {
return sortOrder;
}
+
+ private class StateFilter implements Filter<Capital>, Serializable {
+ private static final long serialVersionUID = 1L;
+
+ public boolean accept(Capital c) {
+ return c.getState().toLowerCase()
+ .contains(stateNameToFilter == null ? "" : stateNameToFilter.toLowerCase());
+ }
+ }
}
Modified: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichDataTableBean.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichDataTableBean.java 2011-02-16 15:51:36 UTC (rev 21699)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichDataTableBean.java 2011-02-16 15:52:15 UTC (rev 21700)
@@ -50,29 +50,21 @@
@ViewScoped
public class RichDataTableBean implements Serializable {
- private static final long serialVersionUID = 4814439475400649809L;
+ private static final long serialVersionUID = -1L;
private static Logger logger;
private Attributes attributes;
- private UIDataTable binding;
+
+ private transient UIDataTable binding;
private DataComponentState dataTableState;
private Map<Object, Integer> stateMap = new HashMap<Object, Integer>();
+
private int page = 1;
// true = model, false = empty table
private boolean state = true;
// sorting
- private ColumnSortingMap sorting = new ColumnSortingMap() {
- private static final long serialVersionUID = 1L;
+ private ColumnSortingMap sorting = new CustomColumnSortingMap();
- protected UIDataTableBase getBinding() {
- return binding;
- }
-
- protected Attributes getAttributes() {
- return attributes;
- }
- };
-
// filtering
private Map<String, Object> filtering = new HashMap<String, Object>();
@@ -189,5 +181,16 @@
}
};
}
+
+ private class CustomColumnSortingMap extends ColumnSortingMap {
+ private static final long serialVersionUID = 1L;
+ protected UIDataTableBase getBinding() {
+ return binding;
+ }
+
+ protected Attributes getAttributes() {
+ return attributes;
+ }
+ }
}
Modified: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichExtendedDataTableBean.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichExtendedDataTableBean.java 2011-02-16 15:51:36 UTC (rev 21699)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichExtendedDataTableBean.java 2011-02-16 15:52:15 UTC (rev 21700)
@@ -49,11 +49,11 @@
@ManagedBean(name = "richExtendedDataTableBean")
@ViewScoped
public class RichExtendedDataTableBean implements Serializable {
-
- private static final long serialVersionUID = 481478880649809L;
+
+ private static final long serialVersionUID = 1L;
private static Logger logger;
private Attributes attributes;
- private DataComponentState dataTableState;
+ private transient DataComponentState dataTableState;
private Map<Object, Integer> stateMap = new HashMap<Object, Integer>();
private int page = 1;
// true = model, false = empty table
@@ -75,7 +75,7 @@
private Map<String, Object> filtering = new HashMap<String, Object>();
// facets
private Map<String, String> facets = new HashMap<String, String>();
- private UIExtendedDataTable binding;
+ private transient UIExtendedDataTable binding;
/**
* Initializes the managed bean.
15 years, 2 months
JBoss Rich Faces SVN: r21699 - in modules/tests/metamer/trunk: ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTreeModelAdaptor and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: lfryc(a)redhat.com
Date: 2011-02-16 10:51:36 -0500 (Wed, 16 Feb 2011)
New Revision: 21699
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTreeModelAdaptor/TestTreeModelAdaptorSelection.java
modules/tests/metamer/trunk/ftest/issue-tracking-query.sh
Log:
fixed issue tracking
Modified: modules/tests/metamer/trunk/ftest/issue-tracking-query.sh
===================================================================
--- modules/tests/metamer/trunk/ftest/issue-tracking-query.sh 2011-02-16 14:48:50 UTC (rev 21698)
+++ modules/tests/metamer/trunk/ftest/issue-tracking-query.sh 2011-02-16 15:51:36 UTC (rev 21699)
@@ -1,17 +1,17 @@
#!/bin/bash
-issues=`find -name "issues.txt" -exec cat {} \; -exec echo '' \; | sed -r 's# #\n#' | sort | uniq | grep RF- | sed -r 's#.*/(RF-[0-9]+)#\1,#'`
+issues=`find -name "issues.txt" -exec cat {} \; -exec echo '' \; | sed -r 's# #\n#' | sort | uniq | egrep 'RF(PL)?-' | sed -r 's#.*/(RF(PL)?-[0-9]+)#\1,#'`
issues=`echo $issues | sed -r 's#,[^A-Z]*$##'`
echo "####################################################################"
echo "############### ALL TRACKED ISSUES #################################"
echo "####################################################################"
-echo "project = RF AND key in ($issues) AND ORDER BY status DESC, key DESC"
+echo "project IN (RF, RFPL) AND key in ($issues) ORDER BY status DESC, key DESC"
echo "####################################################################"
echo "############### ISSUES WHICH ARE NOT LABELED IN JIRA ###############"
echo "####################################################################"
-echo "project = RF AND key in ($issues) AND AND labels != "metamer-ftest-tracked" ORDER BY status DESC, key DESC"
+echo "project IN (RF, RFPL) AND key in ($issues) AND labels != "metamer-ftest-tracked" ORDER BY status DESC, key DESC"
echo "####################################################################"
echo "############### ISSUES LABEL IN JIRA BUT PASSING ###################"
echo "####################################################################"
-echo "project = RF AND key NOT IN ($issues) AND labels = metamer-ftest-tracked ORDER BY status DESC, key DESC"
+echo "project IN (RF, RFPL) AND key NOT IN ($issues) AND labels = metamer-ftest-tracked ORDER BY status DESC, key DESC"
echo "####################################################################"
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTreeModelAdaptor/TestTreeModelAdaptorSelection.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTreeModelAdaptor/TestTreeModelAdaptorSelection.java 2011-02-16 14:48:50 UTC (rev 21698)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTreeModelAdaptor/TestTreeModelAdaptorSelection.java 2011-02-16 15:51:36 UTC (rev 21699)
@@ -95,7 +95,7 @@
@Test
@Override
@Use(field = "paths", value = "paths*")
- @IssueTracking("https://issues.jboss.org/browse/RF-10038")
+ @IssueTracking("https://issues.jboss.org/browse/RFPL-1133")
public void testSubNodesSelection() {
super.testSubNodesSelection();
}
@@ -104,7 +104,7 @@
@Override
@Uses({ @Use(field = "paths", value = "paths*"),
@Use(field = "selectionType", value = "eventEnabledSelectionTypes") })
- @IssueTracking("https://issues.jboss.org/browse/RF-10038")
+ @IssueTracking("https://issues.jboss.org/browse/RFPL-1133")
public void testSubNodesSelectionEvents() {
super.testSubNodesSelectionEvents();
}
15 years, 2 months
JBoss Rich Faces SVN: r21698 - modules/tests/metamer/trunk/ftest.
by richfaces-svn-commits@lists.jboss.org
Author: lfryc(a)redhat.com
Date: 2011-02-16 09:48:50 -0500 (Wed, 16 Feb 2011)
New Revision: 21698
Modified:
modules/tests/metamer/trunk/ftest/pom.xml
Log:
exposed property for configuring testng.listeners
Modified: modules/tests/metamer/trunk/ftest/pom.xml
===================================================================
--- modules/tests/metamer/trunk/ftest/pom.xml 2011-02-16 14:38:31 UTC (rev 21697)
+++ modules/tests/metamer/trunk/ftest/pom.xml 2011-02-16 14:48:50 UTC (rev 21698)
@@ -85,6 +85,7 @@
<testng.suite.xml>src/test/resources/testng.xml</testng.suite.xml>
<container.home>target/installs/${container.dir.deflatted}/${container.dir.unflatted}</container.home>
<jsf.config>Mojarra-2.0</jsf.config>
+ <testng.listeners>org.richfaces.tests.metamer.ftest.MatrixConfigurator,org.richfaces.tests.metamer.ftest.MetamerSeleniumLoggingTestListener,org.richfaces.tests.metamer.ftest.MetamerFailureLoggingTestListener,org.richfaces.tests.metamer.ftest.MetamerConsoleStatusTestListener</testng.listeners>
</properties>
<repositories>
@@ -556,7 +557,7 @@
<properties>
<property>
<name>listener</name>
- <value>org.richfaces.tests.metamer.ftest.MatrixConfigurator,org.richfaces.tests.metamer.ftest.MetamerSeleniumLoggingTestListener,org.richfaces.tests.metamer.ftest.MetamerFailureLoggingTestListener,org.richfaces.tests.metamer.ftest.MetamerConsoleStatusTestListener</value>
+ <value>${testng.listeners}</value>
</property>
</properties>
</configuration>
15 years, 2 months
JBoss Rich Faces SVN: r21697 - trunk/ui/dnd/ui/src/main/java/org/richfaces/component.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2011-02-16 09:38:31 -0500 (Wed, 16 Feb 2011)
New Revision: 21697
Modified:
trunk/ui/dnd/ui/src/main/java/org/richfaces/component/AbstractDropTarget.java
Log:
https://issues.jboss.org/browse/RF-10535 Drop Target - whole lifecycle is processed when @immediate=true or @bypassUpdates=true
Modified: trunk/ui/dnd/ui/src/main/java/org/richfaces/component/AbstractDropTarget.java
===================================================================
--- trunk/ui/dnd/ui/src/main/java/org/richfaces/component/AbstractDropTarget.java 2011-02-16 14:01:57 UTC (rev 21696)
+++ trunk/ui/dnd/ui/src/main/java/org/richfaces/component/AbstractDropTarget.java 2011-02-16 14:38:31 UTC (rev 21697)
@@ -23,6 +23,8 @@
package org.richfaces.component;
import javax.faces.component.UIComponentBase;
+import javax.faces.context.FacesContext;
+import javax.faces.event.AbortProcessingException;
import javax.faces.event.FacesEvent;
import javax.faces.event.PhaseId;
@@ -94,4 +96,14 @@
}
super.queueEvent(event);
}
+
+ @Override
+ public void broadcast(FacesEvent event) throws AbortProcessingException {
+ super.broadcast(event);
+
+ if (event instanceof DropEvent
+ && (isBypassUpdates() || isImmediate())) {
+ FacesContext.getCurrentInstance().renderResponse();
+ }
+ }
}
15 years, 2 months
JBoss Rich Faces SVN: r21696 - in trunk/ui/input/ui/src/main/java/org/richfaces: renderkit and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2011-02-16 09:01:57 -0500 (Wed, 16 Feb 2011)
New Revision: 21696
Modified:
trunk/ui/input/ui/src/main/java/org/richfaces/component/AbstractCalendar.java
trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/CalendarRendererBase.java
trunk/ui/input/ui/src/main/java/org/richfaces/utils/CalendarHelper.java
Log:
https://issues.jboss.org/browse/RF-10470 Calendar: cannot switch month when using custom data model
Modified: trunk/ui/input/ui/src/main/java/org/richfaces/component/AbstractCalendar.java
===================================================================
--- trunk/ui/input/ui/src/main/java/org/richfaces/component/AbstractCalendar.java 2011-02-16 13:46:32 UTC (rev 21695)
+++ trunk/ui/input/ui/src/main/java/org/richfaces/component/AbstractCalendar.java 2011-02-16 14:01:57 UTC (rev 21696)
@@ -342,7 +342,7 @@
// selectedDate
// current date string always has predefined format: m/y
Date currentDate = CalendarHelper.getAsDate(facesContext, this, getCurrentDate());
- Date submittedCurrentDate = CalendarHelper.convertCurrentDate(currentDateString);
+ Date submittedCurrentDate = CalendarHelper.convertCurrentDate(currentDateString, facesContext, this);
currentDateChangeEvent.setCurrentDate(submittedCurrentDate);
if (!submittedCurrentDate.equals(currentDate)) {
@@ -379,7 +379,7 @@
ve.setValue(facesContext.getELContext(), convert.getAsString(facesContext, this, currentDate));
return;
} else if (ve.getType(elContext).equals(Calendar.class)) {
- Calendar c = Calendar.getInstance();
+ Calendar c = CalendarHelper.getCalendar(facesContext, this);
c.setTime((Date) currentDate);
ve.setValue(elContext, c);
return;
@@ -549,7 +549,9 @@
}
public static Object formatStartDate(Date date) {
- Calendar calendar = Calendar.getInstance();
+ FacesContext facesContext = FacesContext.getCurrentInstance();
+ AbstractCalendar calendarInstance=(AbstractCalendar) AbstractCalendar.getCurrentComponent(facesContext);
+ Calendar calendar = CalendarHelper.getCalendar(facesContext, calendarInstance);
calendar.setTime(date);
HashMap <String, Object> hashDate = new HashMap<String,Object>();
hashDate.put("month", calendar.get(Calendar.MONTH));
Modified: trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/CalendarRendererBase.java
===================================================================
--- trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/CalendarRendererBase.java 2011-02-16 13:46:32 UTC (rev 21695)
+++ trunk/ui/input/ui/src/main/java/org/richfaces/renderkit/CalendarRendererBase.java 2011-02-16 14:01:57 UTC (rev 21696)
@@ -278,7 +278,10 @@
}
public static Object formatSelectedDate(TimeZone timeZone, Date date) {
- Calendar calendar = Calendar.getInstance();
+ FacesContext facesContext = FacesContext.getCurrentInstance();
+ AbstractCalendar calendarInstance = (AbstractCalendar) AbstractCalendar.getCurrentComponent(facesContext);
+ Calendar calendar = CalendarHelper.getCalendar(facesContext, calendarInstance);
+
calendar.setTimeZone(timeZone);
calendar.setTime(date);
@@ -308,7 +311,10 @@
}
public static Object formatDate(Date date) {
- Calendar calendar = Calendar.getInstance();
+ FacesContext facesContext = FacesContext.getCurrentInstance();
+ AbstractCalendar calendarInstance = (AbstractCalendar) AbstractCalendar.getCurrentComponent(facesContext);
+ Calendar calendar = CalendarHelper.getCalendar(facesContext, calendarInstance);
+
calendar.setTime(date);
JSFunction result = new JSFunction("new Date");
result.addParameter(calendar.get(Calendar.YEAR));
Modified: trunk/ui/input/ui/src/main/java/org/richfaces/utils/CalendarHelper.java
===================================================================
--- trunk/ui/input/ui/src/main/java/org/richfaces/utils/CalendarHelper.java 2011-02-16 13:46:32 UTC (rev 21695)
+++ trunk/ui/input/ui/src/main/java/org/richfaces/utils/CalendarHelper.java 2011-02-16 14:01:57 UTC (rev 21696)
@@ -179,17 +179,17 @@
}
}
- public static Date convertCurrentDate(String currentDateString) {
- Calendar calendar = Calendar.getInstance();
- calendar.clear();
- calendar.set(Calendar.DATE, 1);
+ public static Date convertCurrentDate(String currentDateString, FacesContext facesContext, AbstractCalendar calendar) {
+ Calendar calendarInner = getCalendar(facesContext, calendar);
+ calendarInner.clear();
+ calendarInner.set(Calendar.DATE, 1);
int idx = currentDateString.indexOf('/');
Date date = null;
if (idx != -1) {
- calendar.set(Calendar.MONTH, Integer.parseInt(currentDateString.substring(0, idx)) - 1);
- calendar.set(Calendar.YEAR, Integer.parseInt(currentDateString.substring(idx + 1)));
- date = calendar.getTime();
+ calendarInner.set(Calendar.MONTH, Integer.parseInt(currentDateString.substring(0, idx)) - 1);
+ calendarInner.set(Calendar.YEAR, Integer.parseInt(currentDateString.substring(idx + 1)));
+ date = calendarInner.getTime();
}
return date;
}
15 years, 2 months
JBoss Rich Faces SVN: r21695 - trunk/ui/output/ui/src/main/java/org/richfaces/component.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2011-02-16 08:46:32 -0500 (Wed, 16 Feb 2011)
New Revision: 21695
Modified:
trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractCollapsiblePanel.java
trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractTogglePanel.java
Log:
RF-10533 Panels: hide common ajax attributes
Modified: trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractCollapsiblePanel.java
===================================================================
--- trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractCollapsiblePanel.java 2011-02-16 13:37:39 UTC (rev 21694)
+++ trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractCollapsiblePanel.java 2011-02-16 13:46:32 UTC (rev 21695)
@@ -138,10 +138,10 @@
@Attribute
public abstract String getHeaderClass();
- @Attribute
+ @Attribute(hidden = true)
public abstract String getOncomplete();
- @Attribute
+ @Attribute(hidden = true)
public abstract String getOnbeforedomupdate();
@Attribute(events = @EventName("switch"))
Modified: trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractTogglePanel.java
===================================================================
--- trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractTogglePanel.java 2011-02-16 13:37:39 UTC (rev 21694)
+++ trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractTogglePanel.java 2011-02-16 13:46:32 UTC (rev 21695)
@@ -630,22 +630,22 @@
@Attribute
public abstract boolean isBypassUpdates();
- @Attribute
+ @Attribute(hidden = true)
public abstract boolean isLimitRender();
@Attribute
public abstract boolean isCycledSwitching();
- @Attribute
+ @Attribute(hidden = true)
public abstract Object getData();
- @Attribute
+ @Attribute(hidden = true)
public abstract String getStatus();
- @Attribute
+ @Attribute(hidden = true)
public abstract Object getExecute();
- @Attribute
+ @Attribute(hidden = true)
public abstract Object getRender();
@Attribute
15 years, 2 months
JBoss Rich Faces SVN: r21694 - trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html.
by richfaces-svn-commits@lists.jboss.org
Author: artdaw
Date: 2011-02-16 08:37:39 -0500 (Wed, 16 Feb 2011)
New Revision: 21694
Modified:
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/PanelMenuRenderer.java
Log:
RF-10302: @width is fixed for Panel Menu
Modified: trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/PanelMenuRenderer.java
===================================================================
--- trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/PanelMenuRenderer.java 2011-02-16 13:05:01 UTC (rev 21693)
+++ trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/PanelMenuRenderer.java 2011-02-16 13:37:39 UTC (rev 21694)
@@ -26,6 +26,7 @@
import org.ajax4jsf.javascript.JSObject;
import org.richfaces.cdk.annotations.JsfRenderer;
import org.richfaces.component.AbstractPanelMenu;
+import org.richfaces.component.util.HtmlUtil;
import org.richfaces.renderkit.HtmlConstants;
import javax.faces.application.ResourceDependencies;
@@ -119,5 +120,10 @@
protected Class<? extends UIComponent> getComponentClass() {
return AbstractPanelMenu.class;
}
+
+ @Override
+ protected String getStyle(UIComponent component) {
+ return HtmlUtil.concatStyles(super.getStyle(component), attributeAsStyle(component, "width"));
+ }
}
15 years, 2 months