JBoss Rich Faces SVN: r20657 - in branches/RF-7654: ui/validator/ui/src/main/resources/META-INF/resources/org.richfaces and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: pyaschenko
Date: 2010-12-17 10:59:45 -0500 (Fri, 17 Dec 2010)
New Revision: 20657
Modified:
branches/RF-7654/core/impl/src/main/resources/META-INF/resources/richfaces-event.js
branches/RF-7654/ui/validator/ui/src/main/resources/META-INF/resources/org.richfaces/csv.js
branches/RF-7654/ui/validator/ui/src/main/resources/META-INF/resources/org.richfaces/message.js
branches/RF-7654/ui/validator/ui/src/main/resources/META-INF/resources/org.richfaces/richfaces-csv.js
branches/RF-7654/ui/validator/ui/src/test/java/org/richfaces/javascript/client/message/MessageTestBase.java
Log:
http://jira.jboss.com/jira/browse/RF-9250
Modified: branches/RF-7654/core/impl/src/main/resources/META-INF/resources/richfaces-event.js
===================================================================
--- branches/RF-7654/core/impl/src/main/resources/META-INF/resources/richfaces-event.js 2010-12-17 15:56:05 UTC (rev 20656)
+++ branches/RF-7654/core/impl/src/main/resources/META-INF/resources/richfaces-event.js 2010-12-17 15:59:45 UTC (rev 20657)
@@ -61,6 +61,8 @@
* @type string
* */
EVENT_NAMESPACE_SEPARATOR : ".",
+
+ MESSAGE_EVENT_TYPE: "onmessage",
/**
* Attach an event handler to execute when the DOM is fully loaded.
Modified: branches/RF-7654/ui/validator/ui/src/main/resources/META-INF/resources/org.richfaces/csv.js
===================================================================
--- branches/RF-7654/ui/validator/ui/src/main/resources/META-INF/resources/org.richfaces/csv.js 2010-12-17 15:56:05 UTC (rev 20656)
+++ branches/RF-7654/ui/validator/ui/src/main/resources/META-INF/resources/org.richfaces/csv.js 2010-12-17 15:59:45 UTC (rev 20657)
@@ -22,16 +22,15 @@
$.extend(rf.csv, {
RE_DIGITS: /^-?\d+$/,
RE_FLOAT: /^(-?\d+)?(\.(\d+)?(e[+-]?\d+)?)?$/,
- MESSAGE_EVENT_NAME: "onmessage",
// Messages API
getMessage :function(facesMessage,values){
return {detail:_interpolateMessage(facesMessage.detail,values),summary:_interpolateMessage(facesMessage.summary,values)};
},
sendMessage: function (componentId, message) {
- rf.Event.fire(window.document, rf.csv.MESSAGE_EVENT_NAME, {'componentId':componentId, 'message':message});
+ rf.Event.fire(window.document, rf.Event.MESSAGE_EVENT_TYPE, {'sourceId':componentId, 'message':message});
},
clearMessage: function (componentId) {
- rf.Event.fire(window.document, rf.csv.MESSAGE_EVENT_NAME, {'componentId':componentId, 'message':''});
+ rf.Event.fire(window.document, rf.Event.MESSAGE_EVENT_TYPE, {'sourceId':componentId, 'message':''});
},
getValue: function (clientId, element){
var value;
@@ -95,66 +94,4 @@
}
});
- /*
- // component ids hash that can send messages
- // each hash item contains array of message component id that receive messages from the component
- _componentIds = {};
- // array of message component id that will receive messages from all components
- _messageComponentIds = {};
-
- var messageDispatchers = {};
- var addDispatcher = function (dispatcherId) {
- };
- var removeDispatcher: function (dispatcherId) {
- };
-
- rf.MessageDispatcher = function(id) {
- this.id = id;
- };
- rf.BaseComponent.extend(rf.MessageDispatcher);
-
- $.extend(rf.MessageDispatcher.prototype, {
- register: function (messageComponentId, componentIds) {
- if (!componentIds || componentIds.length==0) {
- // global message listener
- _messageComponents.push(messageComponentId);
- }
- var messageComponents;
- for (var i=0;i<componentIds.length;i++) {
- messageComponents = _components[componentIds[i]];
- if (!messageComponents) {
- messageComponents = _components[componentIds[i]] = [];
- }
- messageComponents.push(messageComponentId);
- }
- },
- unregister: function (messageComponentId) {
- var messageComponents;
- for (var i=0;i<_components.length;i++) {
- messageComponents = _components[i];
- if (!messageComponents) {
- messageComponents = _components[componentIds[i]] = [];
- }
- messageComponents.push(messageComponentId);
- }
- },
- send: function (componentId, message) {
- var messageComponents = _components[componentId];
- if (messageComponents) {
- for (var i=0;i<messageComponents.length;i++) {
- rf.$(messageComponents[id]).update(message);
- }
- }
- }
- });
- */
-
- /*
- * message.constructor () {
- * rf.Event.bindById(componentId, "onMessage.RichFaces", onMessage );
- * rf.Event.bindById(document, "onMessage.RichFaces", onMessage );
- * }
- *
- */
-
})(jQuery, window.RichFaces || (window.RichFaces={}));
\ No newline at end of file
Modified: branches/RF-7654/ui/validator/ui/src/main/resources/META-INF/resources/org.richfaces/message.js
===================================================================
--- branches/RF-7654/ui/validator/ui/src/main/resources/META-INF/resources/org.richfaces/message.js 2010-12-17 15:56:05 UTC (rev 20656)
+++ branches/RF-7654/ui/validator/ui/src/main/resources/META-INF/resources/org.richfaces/message.js 2010-12-17 15:59:45 UTC (rev 20657)
@@ -52,18 +52,18 @@
var onMessage = function (event, element, data) {
if (!this.options.forComponentId) {
- var index = componentHash[data.componentId];
+ var index = componentHash[data.sourceId];
if (typeof index != undefined) {
$(rf.getDomElement(this.id+":Content"+index)).remove();
}
var content = content = $(rf.getDomElement(this.id+":Content"));
componentIndex ++;
- if (data.message) content.append('<li id="'+this.id+":Content"+componentIndex+'">'+data.message+'</li>');
- componentHash[data.componentId] = componentIndex;
+ if (data.message) content.append('<li id="'+this.id+":Content"+componentIndex+'">'+data.message.summary+'</li>');
+ componentHash[data.sourceId] = componentIndex;
- } else if (this.options.forComponentId==data.componentId) {
- rf.getDomElement(this.id+":Content").innerHTML = data.message ? '<li>'+data.message+'</li>' : '';
+ } else if (this.options.forComponentId==data.sourceId) {
+ rf.getDomElement(this.id+":Content").innerHTML = data.message ? '<li>'+data.message.summary+'</li>' : '';
}
}
Modified: branches/RF-7654/ui/validator/ui/src/main/resources/META-INF/resources/org.richfaces/richfaces-csv.js
===================================================================
--- branches/RF-7654/ui/validator/ui/src/main/resources/META-INF/resources/org.richfaces/richfaces-csv.js 2010-12-17 15:56:05 UTC (rev 20656)
+++ branches/RF-7654/ui/validator/ui/src/main/resources/META-INF/resources/org.richfaces/richfaces-csv.js 2010-12-17 15:59:45 UTC (rev 20657)
@@ -11,7 +11,6 @@
$.extend(rf.csv, {
RE_DIGITS: /^-?\d+$/,
RE_FLOAT: /^(-?\d+)?(\.(\d+)?(e[+-]?\d+)?)?$/,
- MESSAGE_EVENT_NAME: "onmessage."+rf.Event.RICH_NAMESPACE,
// Messages API
addMessage: function (messagesObject) {
$.extend(_messages, messagesObject);
@@ -30,8 +29,7 @@
return {message:message};
},
sendMessage: function (componentId, message) {
- rf.Event.fireById(document, MESSAGE_EVENT_NAME, message);
- rf.Event.fireById(componentId, MESSAGE_EVENT_NAME, message);
+ rf.Event.fire(window.document, rf.Event.MESSAGE_EVENT_TYPE, {'sourceId':componentId, 'message':message});
},
// Converters API
addConverter: function (converterFunctions) {
@@ -87,66 +85,4 @@
}
});
- /*
- // component ids hash that can send messages
- // each hash item contains array of message component id that receive messages from the component
- _componentIds = {};
- // array of message component id that will receive messages from all components
- _messageComponentIds = {};
-
- var messageDispatchers = {};
- var addDispatcher = function (dispatcherId) {
- };
- var removeDispatcher: function (dispatcherId) {
- };
-
- rf.MessageDispatcher = function(id) {
- this.id = id;
- };
- rf.BaseComponent.extend(rf.MessageDispatcher);
-
- $.extend(rf.MessageDispatcher.prototype, {
- register: function (messageComponentId, componentIds) {
- if (!componentIds || componentIds.length==0) {
- // global message listener
- _messageComponents.push(messageComponentId);
- }
- var messageComponents;
- for (var i=0;i<componentIds.length;i++) {
- messageComponents = _components[componentIds[i]];
- if (!messageComponents) {
- messageComponents = _components[componentIds[i]] = [];
- }
- messageComponents.push(messageComponentId);
- }
- },
- unregister: function (messageComponentId) {
- var messageComponents;
- for (var i=0;i<_components.length;i++) {
- messageComponents = _components[i];
- if (!messageComponents) {
- messageComponents = _components[componentIds[i]] = [];
- }
- messageComponents.push(messageComponentId);
- }
- },
- send: function (componentId, message) {
- var messageComponents = _components[componentId];
- if (messageComponents) {
- for (var i=0;i<messageComponents.length;i++) {
- rf.$(messageComponents[id]).update(message);
- }
- }
- }
- });
- */
-
- /*
- * message.constructor () {
- * rf.Event.bindById(componentId, "onMessage.RichFaces", onMessage );
- * rf.Event.bindById(document, "onMessage.RichFaces", onMessage );
- * }
- *
- */
-
})(jQuery, window.RichFaces || (window.RichFaces={}));
\ No newline at end of file
Modified: branches/RF-7654/ui/validator/ui/src/test/java/org/richfaces/javascript/client/message/MessageTestBase.java
===================================================================
--- branches/RF-7654/ui/validator/ui/src/test/java/org/richfaces/javascript/client/message/MessageTestBase.java 2010-12-17 15:56:05 UTC (rev 20656)
+++ branches/RF-7654/ui/validator/ui/src/test/java/org/richfaces/javascript/client/message/MessageTestBase.java 2010-12-17 15:59:45 UTC (rev 20657)
@@ -5,7 +5,6 @@
import org.ajax4jsf.javascript.JSFunction;
import org.jboss.test.qunit.Qunit;
import org.jboss.test.qunit.Qunit.Builder;
-import org.junit.Before;
import org.junit.Rule;
import org.richfaces.javascript.Message;
14 years
JBoss Rich Faces SVN: r20656 - 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: 2010-12-17 10:56:05 -0500 (Fri, 17 Dec 2010)
New Revision: 20656
Modified:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichInplaceSelectBean.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInplaceSelect/TestRichInplaceSelect.java
Log:
* tests for inplace select fixed
Modified: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichInplaceSelectBean.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichInplaceSelectBean.java 2010-12-17 15:24:53 UTC (rev 20655)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichInplaceSelectBean.java 2010-12-17 15:56:05 UTC (rev 20656)
@@ -76,6 +76,7 @@
attributes.setAttribute("listWidth", "200px");
attributes.setAttribute("openOnEdit", true);
attributes.setAttribute("rendered", true);
+ attributes.setAttribute("saveOnBlur", true);
attributes.setAttribute("saveOnSelect", true);
// TODO has to be tested in another way
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 2010-12-17 15:24:53 UTC (rev 20655)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInplaceSelect/TestRichInplaceSelect.java 2010-12-17 15:56:05 UTC (rev 20656)
@@ -23,14 +23,15 @@
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 org.jboss.test.selenium.css.CssProperty;
-
import org.jboss.test.selenium.dom.Event;
import org.jboss.test.selenium.locator.JQueryLocator;
import org.jboss.test.selenium.waiting.EventFiredCondition;
@@ -54,6 +55,7 @@
private JQueryLocator options = jq("span.rf-is-opt:eq({0})"); // 00..49
private JQueryLocator okButton = jq("input.rf-is-btn[id$=Okbtn]");
private JQueryLocator cancelButton = jq("input.rf-is-btn[id$=Cancelbtn]");
+ private JQueryLocator output = pjq("span[id$=output]");
@Override
public URL getTestUrl() {
@@ -85,11 +87,17 @@
assertEquals(selenium.getText(options.format(i)), selectOptions[i / 10], "Select option nr. " + i);
}
- guardNoRequest(selenium).click(options.format(10));
+ 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.");
+
+ String listenerText = selenium.getText(jq("div#phasesPanel li:eq(3)"));
+ assertEquals(listenerText, "* value changed: null -> Hawaii", "Value change listener was not invoked.");
}
@Test
@@ -176,7 +184,13 @@
@Test
@IssueTracking("https://jira.jboss.org/browse/RF-9849")
public void testOnblur() {
- testFireEvent(Event.BLUR, select);
+ selenium.type(pjq("input[id$=onblurInput]"), "metamerEvents += \"blur \"");
+ selenium.waitForPageToLoad(TIMEOUT);
+
+ selenium.click(options.format(10));
+ guardXhr(selenium).fireEvent(input, Event.BLUR);
+
+ waitGui.failWith("Attribute onblur does not work correctly").until(new EventFiredCondition(Event.BLUR));
}
@Test
@@ -187,6 +201,7 @@
selenium.click(select);
selenium.click(options.format(10));
+ guardXhr(selenium).fireEvent(input, Event.BLUR);
waitGui.failWith("Attribute onchange does not work correctly").until(
new EventFiredCondition(Event.CHANGE));
@@ -205,12 +220,13 @@
@Test
@IssueTracking("https://jira.jboss.org/browse/RF-9849")
public void testOnfocus() {
- testFireEvent(Event.FOCUS, select);
- }
+ selenium.type(pjq("input[type=text][id$=onfocusInput]"), "metamerEvents += \"focus \"");
+ selenium.waitForPageToLoad();
- @Test
- public void testOninputblur() {
- testFireEvent(Event.BLUR, input, "inputblur");
+ selenium.click(select);
+
+ waitGui.failWith("Attribute onfocus does not work correctly").until(
+ new EventFiredCondition(Event.FOCUS));
}
@Test
@@ -224,11 +240,6 @@
}
@Test
- public void testOninputfocus() {
- testFireEvent(Event.FOCUS, input, "inputfocus");
- }
-
- @Test
public void testOninputkeydown() {
testFireEvent(Event.KEYDOWN, input, "inputkeydown");
}
@@ -364,9 +375,15 @@
}
@Test
- @IssueTracking("https://jira.jboss.org/browse/RF-9849")
- public void testOnselect() {
- testFireEvent(Event.SELECT, input);
+ public void testOnselectitem() {
+ selenium.type(pjq("input[type=text][id$=onselectitemInput]"), "metamerEvents += \"selectitem \"");
+ selenium.waitForPageToLoad();
+
+ selenium.click(select);
+ selenium.click(options.format(10));
+
+ waitGui.failWith("Attribute onselectitem does not work correctly").until(
+ new EventFiredCondition(new Event("selectitem")));
}
@Test
@@ -463,7 +480,7 @@
selenium.click(select);
selenium.mouseOver(options.format(0));
-
+
assertTrue(selenium.belongsClass(options.format(0), "metamer-ftest-class"), "Selected item does not contain defined class.");
for (int i = 1; i < 50; i++) {
assertFalse(selenium.belongsClass(options.format(i), "metamer-ftest-class"), "Not selected item " + i + " should not contain defined class.");
14 years
JBoss Rich Faces SVN: r20655 - in branches/enterprise/3.3.1.SP2_RFPL-967/framework/impl/src/main/java/org/ajax4jsf: util and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: jbalunas(a)redhat.com
Date: 2010-12-17 10:24:53 -0500 (Fri, 17 Dec 2010)
New Revision: 20655
Added:
branches/enterprise/3.3.1.SP2_RFPL-967/framework/impl/src/main/java/org/ajax4jsf/util/DocumentBuilderPool.java
Modified:
branches/enterprise/3.3.1.SP2_RFPL-967/framework/impl/src/main/java/org/ajax4jsf/context/ResponseWriterContentHandler.java
Log:
RFPL-967, RF-10035 - added pooling for document builder
Modified: branches/enterprise/3.3.1.SP2_RFPL-967/framework/impl/src/main/java/org/ajax4jsf/context/ResponseWriterContentHandler.java
===================================================================
--- branches/enterprise/3.3.1.SP2_RFPL-967/framework/impl/src/main/java/org/ajax4jsf/context/ResponseWriterContentHandler.java 2010-12-17 15:11:12 UTC (rev 20654)
+++ branches/enterprise/3.3.1.SP2_RFPL-967/framework/impl/src/main/java/org/ajax4jsf/context/ResponseWriterContentHandler.java 2010-12-17 15:24:53 UTC (rev 20655)
@@ -22,10 +22,11 @@
package org.ajax4jsf.context;
import javax.faces.FacesException;
-import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.ParserConfigurationException;
import org.ajax4jsf.renderkit.RendererUtils.HTML;
+import org.ajax4jsf.util.DocumentBuilderPool;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
@@ -44,12 +45,21 @@
public ResponseWriterContentHandler(String linkClass) {
super();
+ DocumentBuilder builder = null;
+
try {
- Document document = DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();
+ //Pull the document builder from pool
+ builder = DocumentBuilderPool.getDocumentBuilder();
+
+ //create a new document & initialize
+ Document document = builder.newDocument();
node = document.createElement("head");
document.appendChild(node);
} catch (ParserConfigurationException e) {
throw new FacesException(e.getLocalizedMessage(), e);
+ }finally{
+ //Must always return the document builder to pool
+ DocumentBuilderPool.returnDocumentBuilder(builder);
}
this.linkClass = linkClass;
@@ -127,5 +137,4 @@
return list;
}
-
}
\ No newline at end of file
Added: branches/enterprise/3.3.1.SP2_RFPL-967/framework/impl/src/main/java/org/ajax4jsf/util/DocumentBuilderPool.java
===================================================================
--- branches/enterprise/3.3.1.SP2_RFPL-967/framework/impl/src/main/java/org/ajax4jsf/util/DocumentBuilderPool.java (rev 0)
+++ branches/enterprise/3.3.1.SP2_RFPL-967/framework/impl/src/main/java/org/ajax4jsf/util/DocumentBuilderPool.java 2010-12-17 15:24:53 UTC (rev 20655)
@@ -0,0 +1,100 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright ${year}, 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.ajax4jsf.util;
+
+import java.util.EmptyStackException;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+
+import org.apache.commons.collections.ArrayStack;
+
+/**
+ * Manages a shared pool of DocumentBuilders so that there is not a performance
+ * hit for every request to create.
+ *
+ * @author balunasj(a)redhat.com
+ *
+ */
+public class DocumentBuilderPool {
+
+ // How big the pool is
+ private static final int POOL_SIZE = 100;
+
+ // status array for pool storage
+ private static ArrayStack _documentBuilderPool;
+
+ /**
+ * Get a pooled instance of DocumentBuilder
+ * @return Pooled DocumentBulder
+ * @throws ParserConfigurationException
+ */
+ public static DocumentBuilder getDocumentBuilder() throws ParserConfigurationException{
+ DocumentBuilder builder = null;
+
+ //Check if pool needs to be initialized
+ if (_documentBuilderPool == null){
+ //Sync to avoid conflicts
+ synchronized (DocumentBuilderPool.class) {
+ //Second level check
+ if (_documentBuilderPool == null){
+ _documentBuilderPool = new ArrayStack(POOL_SIZE);
+ }
+ }
+ }
+
+ try {
+ //freeze the pool
+ synchronized (_documentBuilderPool) {
+ //pop the top builder - if empty it will through EmptyStackException
+ builder = (DocumentBuilder) _documentBuilderPool.pop();
+ }
+ } catch (EmptyStackException e) {
+ //Stack is empty, create a new builder
+ builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
+ }
+
+ return builder;
+ }
+
+ /**
+ * Returns a builder to the pool
+ * @param builder
+ */
+ public static void returnDocumentBuilder(DocumentBuilder builder) {
+ //validate the builder
+ if (null != builder) {
+ synchronized (_documentBuilderPool) {
+ //only add if the pool is full
+ if (_documentBuilderPool.size() < POOL_SIZE) {
+ //reset the builder to initial state
+ builder.reset();
+
+ //push the builder back
+ _documentBuilderPool.push(builder);
+ }
+ }
+ }
+ }
+
+}
14 years
JBoss Rich Faces SVN: r20654 - in trunk/ui/output/ui/src/main: templates and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: amarkhel
Date: 2010-12-17 10:11:12 -0500 (Fri, 17 Dec 2010)
New Revision: 20654
Modified:
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/ToolbarGroupRenderer.java
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/ToolbarRendererBase.java
trunk/ui/output/ui/src/main/templates/toolbar.template.xml
Log:
RF-9969 Toolbar: attributes for event handlers ignored
Modified: trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/ToolbarGroupRenderer.java
===================================================================
--- trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/ToolbarGroupRenderer.java 2010-12-17 15:10:07 UTC (rev 20653)
+++ trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/ToolbarGroupRenderer.java 2010-12-17 15:11:12 UTC (rev 20654)
@@ -65,9 +65,9 @@
private void renderChild(FacesContext facesContext, AbstractToolbarGroup toolbarGroup, ResponseWriter writer,
UIComponent child) throws IOException {
writer.startElement(HtmlConstants.TD_ELEM, toolbarGroup);
+ writer.writeAttribute(HtmlConstants.ID_ATTRIBUTE, encodeClientItemID(child), null);
writeClassValue(toolbarGroup, writer);
writeStyleValue(toolbarGroup, writer);
- encodeEventsAttributes(facesContext, toolbarGroup);
child.encodeAll(facesContext);
writer.endElement(HtmlConstants.TD_ELEM);
}
Modified: trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/ToolbarRendererBase.java
===================================================================
--- trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/ToolbarRendererBase.java 2010-12-17 15:10:07 UTC (rev 20653)
+++ trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/ToolbarRendererBase.java 2010-12-17 15:11:12 UTC (rev 20654)
@@ -24,11 +24,13 @@
import java.io.IOException;
import java.util.Collections;
+import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
+import javax.faces.application.ResourceDependencies;
import javax.faces.application.ResourceDependency;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
@@ -40,10 +42,15 @@
import org.richfaces.renderkit.HtmlConstants;
import org.richfaces.renderkit.RenderKitUtils;
import org.richfaces.renderkit.RendererBase;
+import org.richfaces.renderkit.RenderKitUtils.ScriptHashVariableWrapper;
import org.richfaces.renderkit.util.HtmlDimensions;
-@ResourceDependency(library = "org.richfaces", name = "toolbar.ecss")
+
+@ResourceDependencies({
+ @ResourceDependency(name = "jquery.js"),
+ @ResourceDependency(library = "org.richfaces", name = "toolbar.ecss")
+ })
public abstract class ToolbarRendererBase extends RendererBase {
public static final String RENDERER_TYPE = "org.richfaces.ToolbarRenderer";
@@ -215,11 +222,11 @@
if (!(child instanceof AbstractToolbarGroup)) {
writer.startElement(HtmlConstants.TD_ELEM, component);
+ writer.writeAttribute(HtmlConstants.ID_ATTRIBUTE, encodeClientItemID(child), null);
writer.writeAttribute(HtmlConstants.CLASS_ATTRIBUTE, concatClasses("rf-tb-itm", itemClass), null);
if (isPropertyRendered(itemStyle)) {
writer.writeAttribute(HtmlConstants.STYLE_ATTRIBUTE, itemStyle, null);
}
- encodeEventsAttributes(context, toolbar);
}
child.encodeAll(context);
@@ -339,11 +346,6 @@
return true;
}
- protected void encodeEventsAttributes(FacesContext facesContext, UIComponent component)
- throws IOException {
- RenderKitUtils.renderPassThroughAttributesOptimized(facesContext, component, ITEMS_HANDLER_ATTRIBUTES);
- }
-
protected boolean isPropertyRendered(String property) {
return (null != property && !"".equals(property));
}
@@ -363,4 +365,69 @@
return "";
}
}
+
+ protected Map<String, Object> getOptions(UIComponent component) {
+ if (component == null) {
+ return null;
+ }
+ HashMap<String, Object> results = new HashMap<String, Object>();
+ if (component instanceof AbstractToolbar) {
+ Map<String, Object> tbEvents = new HashMap<String, Object>();
+ for (ComponentAttribute componentAttribute :ITEMS_HANDLER_ATTRIBUTES.values()) {
+ Object attr = component.getAttributes().get(componentAttribute.getComponentAttributeName());
+ if (attr != null) {
+ RenderKitUtils.addToScriptHash(tbEvents, componentAttribute.getHtmlAttributeName(),
+ attr, null, ScriptHashVariableWrapper.eventHandler);
+ }
+ }
+ results.put("id", component.getClientId());
+ results.put("events", tbEvents);
+
+ List<AbstractToolbarGroup> groups = getToolBarGroups((AbstractToolbar) component);
+ List<Map<String, Object>> tbgListOptions = new LinkedList<Map<String, Object>>();
+
+ for (AbstractToolbarGroup tbg : groups) {
+
+ Map<String, Object> tbgOptions = new HashMap<String, Object>();
+ Map<String, Object> tbgEvents = new HashMap<String, Object>();
+ List<String> tbgIDs = new LinkedList<String>();
+
+ for (UIComponent comp : tbg.getChildren()) {
+ tbgIDs.add(encodeClientItemID(comp));
+ }
+
+ for (ComponentAttribute componentAttribute :ITEMS_HANDLER_ATTRIBUTES.values()) {
+ Object attr = tbg.getAttributes().get(componentAttribute.getComponentAttributeName());
+ if (attr != null) {
+ RenderKitUtils.addToScriptHash(tbgEvents, componentAttribute.getHtmlAttributeName(),
+ attr, null, ScriptHashVariableWrapper.eventHandler);
+ }
+ }
+ if (!tbgEvents.isEmpty()) {
+ tbgOptions.put("events", tbgEvents);
+ tbgOptions.put("ids", tbgIDs);
+ tbgListOptions.add(tbgOptions);
+ }
+ }
+
+ results.put("groups", tbgListOptions);
+ }
+ return results;
+ }
+
+ protected String encodeClientItemID(UIComponent component) {
+ return component != null ? component.getClientId() + "_itm":"";
+ }
+
+ private List<AbstractToolbarGroup> getToolBarGroups(AbstractToolbar toolBar) {
+ List<AbstractToolbarGroup> list = new LinkedList<AbstractToolbarGroup>();
+ if (toolBar != null) {
+ for (UIComponent comp : toolBar.getChildren()) {
+ if (comp instanceof AbstractToolbarGroup) {
+ list.add((AbstractToolbarGroup) comp);
+ }
+ }
+ }
+ return list;
+ }
}
Modified: trunk/ui/output/ui/src/main/templates/toolbar.template.xml
===================================================================
--- trunk/ui/output/ui/src/main/templates/toolbar.template.xml 2010-12-17 15:10:07 UTC (rev 20653)
+++ trunk/ui/output/ui/src/main/templates/toolbar.template.xml 2010-12-17 15:11:12 UTC (rev 20654)
@@ -20,11 +20,13 @@
class="rf-tb #{component.attributes['styleClass']}"
style="#{ component.attributes['style']}"
cdk:passThroughWithExclusions="">
- <cdk:call expression="encodeEventsAttributes(facesContext, component)" />
<cdk:call expression="renderColElements(facesContext, component)" />
<tr class="rf-tb-cntr">
<cdk:body />
</tr>
</table>
+ <script type="text/javascript">
+ #{toScriptArgs(getOptions(component))}
+ </script>
</cc:implementation>
</cdk:root>
14 years
JBoss Rich Faces SVN: r20653 - trunk/ui/iteration/ui/src/main/resources/META-INF/resources/org.richfaces.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2010-12-17 10:10:07 -0500 (Fri, 17 Dec 2010)
New Revision: 20653
Modified:
trunk/ui/iteration/ui/src/main/resources/META-INF/resources/org.richfaces/tree.ecss
Log:
https://issues.jboss.org/browse/RF-10034
Modified: trunk/ui/iteration/ui/src/main/resources/META-INF/resources/org.richfaces/tree.ecss
===================================================================
--- trunk/ui/iteration/ui/src/main/resources/META-INF/resources/org.richfaces/tree.ecss 2010-12-17 15:07:49 UTC (rev 20652)
+++ trunk/ui/iteration/ui/src/main/resources/META-INF/resources/org.richfaces/tree.ecss 2010-12-17 15:10:07 UTC (rev 20653)
@@ -38,7 +38,7 @@
margin-left: 16px;
}
-.rf-trn-ico, .rf-trn-hnd, .rf-trn-ldn-fct {
+.rf-trn-ico, .rf-trn-hnd, .rf-trn-hnd-ldn-fct {
vertical-align: middle;
margin: 0px;
cursor: pointer;
14 years
JBoss Rich Faces SVN: r20652 - trunk/examples/iteration-demo/src/main/webapp.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2010-12-17 10:07:49 -0500 (Fri, 17 Dec 2010)
New Revision: 20652
Modified:
trunk/examples/iteration-demo/src/main/webapp/tree.xhtml
Log:
https://issues.jboss.org/browse/RF-10034
Modified: trunk/examples/iteration-demo/src/main/webapp/tree.xhtml
===================================================================
--- trunk/examples/iteration-demo/src/main/webapp/tree.xhtml 2010-12-17 15:04:58 UTC (rev 20651)
+++ trunk/examples/iteration-demo/src/main/webapp/tree.xhtml 2010-12-17 15:07:49 UTC (rev 20652)
@@ -249,10 +249,10 @@
</h:panelGroup>
</h:panelGrid>
- 'loading' facet:
+ 'handleLoading' facet:
<it:tree value="#{treeBean.rootNodes}" toggleType="ajax" var="node">
<it:treeNode>
- <f:facet name="loading">
+ <f:facet name="handleLoading">
<h:graphicImage value="/images/loading.gif" />
</f:facet>
@@ -260,7 +260,7 @@
</it:treeNode>
</it:tree>
- 'loading' without facet:
+ 'handleLoading' without facet:
<it:tree value="#{treeBean.rootNodes}" toggleType="ajax" var="node" styleClass="loadingWithoutFacet" />
<a4j:queue />
14 years
JBoss Rich Faces SVN: r20651 - modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest.
by richfaces-svn-commits@lists.jboss.org
Author: lfryc(a)redhat.com
Date: 2010-12-17 10:04:58 -0500 (Fri, 17 Dec 2010)
New Revision: 20651
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/AbstractMetamerTest.java
Log:
removed the fix for invalidateSession() - works fine on tomcat and jboss (problematic on glassfish)
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/AbstractMetamerTest.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/AbstractMetamerTest.java 2010-12-17 15:01:11 UTC (rev 20650)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/AbstractMetamerTest.java 2010-12-17 15:04:58 UTC (rev 20651)
@@ -101,16 +101,6 @@
@AfterMethod(alwaysRun = true)
public void invalidateSession() {
selenium.deleteAllVisibleCookies();
-
- // TODO slow and unreliable solution
- selenium.open(contextPath);
- selenium.waitForPageToLoad(TIMEOUT);
- JQueryLocator button = jq("input[id$=invalidateSessionButton]");
-
- if (selenium.isElementPresent(button)) {
- selenium.click(button);
- selenium.waitForPageToLoad(TIMEOUT);
- }
}
/**
14 years
JBoss Rich Faces SVN: r20650 - in trunk/ui/iteration/ui/src/main: resources/META-INF/resources/org.richfaces and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2010-12-17 10:01:11 -0500 (Fri, 17 Dec 2010)
New Revision: 20650
Modified:
trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/TreeNodeRendererBase.java
trunk/ui/iteration/ui/src/main/resources/META-INF/resources/org.richfaces/tree.ecss
trunk/ui/iteration/ui/src/main/templates/treeNode.template.xml
Log:
https://issues.jboss.org/browse/RF-10034
Modified: trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/TreeNodeRendererBase.java
===================================================================
--- trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/TreeNodeRendererBase.java 2010-12-17 14:36:40 UTC (rev 20649)
+++ trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/TreeNodeRendererBase.java 2010-12-17 15:01:11 UTC (rev 20650)
@@ -53,7 +53,7 @@
private static final String TRIGGER_NODE_AJAX_UPDATE = "__TRIGGER_NODE_AJAX_UPDATE";
- private static final String LOADING_FACET_NAME = "loading";
+ private static final String HANDLE_LOADING_FACET_NAME = "handleLoading";
@Override
public void decode(FacesContext context, UIComponent component) {
@@ -171,7 +171,7 @@
renderingContext.addHandlers(treeNode);
}
- protected UIComponent getLoadingFacetIfApplicable(UIComponent component) {
+ protected UIComponent getHandleLoadingFacetIfApplicable(UIComponent component) {
AbstractTreeNode treeNode = (AbstractTreeNode) component;
AbstractTree tree = treeNode.findTreeComponent();
@@ -180,11 +180,15 @@
return null;
}
- UIComponent facet = treeNode.getFacet(LOADING_FACET_NAME);
+ UIComponent facet = treeNode.getFacet(HANDLE_LOADING_FACET_NAME);
if (facet == null) {
- facet = tree.getFacet(LOADING_FACET_NAME);
+ facet = tree.getFacet(HANDLE_LOADING_FACET_NAME);
}
- return facet;
+ if (facet != null && facet.isRendered()) {
+ return facet;
+ }
+
+ return null;
}
}
Modified: trunk/ui/iteration/ui/src/main/resources/META-INF/resources/org.richfaces/tree.ecss
===================================================================
--- trunk/ui/iteration/ui/src/main/resources/META-INF/resources/org.richfaces/tree.ecss 2010-12-17 14:36:40 UTC (rev 20649)
+++ trunk/ui/iteration/ui/src/main/resources/META-INF/resources/org.richfaces/tree.ecss 2010-12-17 15:01:11 UTC (rev 20650)
@@ -80,15 +80,15 @@
display: none;
}
-.rf-trn-ldn-fct {
+.rf-trn-hnd-ldn-fct {
cursor: default;
display: none;
}
-.rf-trn-ldn > .rf-trn-ldn-fct {
+.rf-trn-ldn > .rf-trn-hnd-ldn-fct {
display: inline-block;
}
-.rf-trn-ldn > .rf-trn-ldn-fct + .rf-trn-hnd {
+.rf-trn-ldn > .rf-trn-hnd-ldn-fct + .rf-trn-hnd {
display: none;
}
\ No newline at end of file
Modified: trunk/ui/iteration/ui/src/main/templates/treeNode.template.xml
===================================================================
--- trunk/ui/iteration/ui/src/main/templates/treeNode.template.xml 2010-12-17 14:36:40 UTC (rev 20649)
+++ trunk/ui/iteration/ui/src/main/templates/treeNode.template.xml 2010-12-17 15:01:11 UTC (rev 20650)
@@ -27,10 +27,10 @@
<div class="#{concatClasses('rf-trn', component.attributes['styleClass'], tree.attributes['nodeClass'])}"
cdk:passThroughWithExclusions="">
- <cdk:object name="loadingFacet" type="UIComponent" value="#{getLoadingFacetIfApplicable(component)}" />
+ <cdk:object name="loadingFacet" type="UIComponent" value="#{getHandleLoadingFacetIfApplicable(component)}" />
<c:if test="#{not empty loadingFacet and loadingFacet.isRendered()}">
- <span class="rf-trn-ldn-fct">
+ <span class="rf-trn-hnd-ldn-fct">
<cdk:call>
loadingFacet.encodeAll(facesContext);
</cdk:call>
14 years
JBoss Rich Faces SVN: r20649 - in trunk/ui/iteration/ui/src: test/java/org/richfaces/renderkit and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: Alex.Kolonitsky
Date: 2010-12-17 09:36:40 -0500 (Fri, 17 Dec 2010)
New Revision: 20649
Modified:
trunk/ui/iteration/ui/src/main/resources/META-INF/resources/org.richfaces/extendedDataTable.js
trunk/ui/iteration/ui/src/test/java/org/richfaces/renderkit/ExtendedDataTableRendererTest.java
Log:
unignore test
Modified: trunk/ui/iteration/ui/src/main/resources/META-INF/resources/org.richfaces/extendedDataTable.js
===================================================================
--- trunk/ui/iteration/ui/src/main/resources/META-INF/resources/org.richfaces/extendedDataTable.js 2010-12-17 14:34:19 UTC (rev 20648)
+++ trunk/ui/iteration/ui/src/main/resources/META-INF/resources/org.richfaces/extendedDataTable.js 2010-12-17 14:36:40 UTC (rev 20649)
@@ -636,6 +636,10 @@
jQuery(window).unbind("resize", updateLayout);
jQuery(richfaces.getDomElement(id + ':st')).remove();
}
+
+ this.detach = function () {
+ // TODO see implementation in richfaces-base-component.js
+ };
this.getColumnPosition = function(id) {
var position;
Modified: trunk/ui/iteration/ui/src/test/java/org/richfaces/renderkit/ExtendedDataTableRendererTest.java
===================================================================
--- trunk/ui/iteration/ui/src/test/java/org/richfaces/renderkit/ExtendedDataTableRendererTest.java 2010-12-17 14:34:19 UTC (rev 20648)
+++ trunk/ui/iteration/ui/src/test/java/org/richfaces/renderkit/ExtendedDataTableRendererTest.java 2010-12-17 14:36:40 UTC (rev 20649)
@@ -51,7 +51,6 @@
* @author Konstantin Mishin
*
*/
-@Ignore
public class ExtendedDataTableRendererTest {
private HtmlUnitEnvironment environment;
14 years
JBoss Rich Faces SVN: r20648 - 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: 2010-12-17 09:34:19 -0500 (Fri, 17 Dec 2010)
New Revision: 20648
Modified:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichInplaceInputBean.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInplaceInput/TestRichInplaceInput.java
Log:
* tests for inplace input fixed
Modified: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichInplaceInputBean.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichInplaceInputBean.java 2010-12-17 14:33:46 UTC (rev 20647)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichInplaceInputBean.java 2010-12-17 14:34:19 UTC (rev 20648)
@@ -59,6 +59,7 @@
attributes.setAttribute("defaultLabel", "Click here to edit");
attributes.setAttribute("editEvent", "click");
attributes.setAttribute("rendered", true);
+ attributes.setAttribute("saveOnBlur", true);
attributes.setAttribute("value", "RichFaces 4");
// TODO has to be tested in another way
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInplaceInput/TestRichInplaceInput.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInplaceInput/TestRichInplaceInput.java 2010-12-17 14:33:46 UTC (rev 20647)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInplaceInput/TestRichInplaceInput.java 2010-12-17 14:34:19 UTC (rev 20648)
@@ -35,7 +35,6 @@
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;
@@ -88,6 +87,9 @@
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.");
}
@Test
@@ -139,7 +141,7 @@
}
@Test
- @IssueTracking("https://javaserverfaces.dev.java.net/issues/show_bug.cgi?id=1805")
+ @IssueTracking("http://java.net/jira/browse/JAVASERVERFACES-1805")
public void testInputWidth() {
selenium.type(pjq("input[type=text][id$=inputWidthInput]"), "300px");
selenium.waitForPageToLoad();
@@ -168,10 +170,32 @@
@Test
@IssueTracking("https://jira.jboss.org/browse/RF-9868")
public void testOnblur() {
- testFireEvent(Event.BLUR, inplaceInput);
+ selenium.type(pjq("input[id$=onblurInput]"), "metamerEvents += \"blur \"");
+ selenium.waitForPageToLoad(TIMEOUT);
+
+ selenium.click(inplaceInput);
+ selenium.fireEvent(input, Event.BLUR);
+
+ waitGui.failWith("Attribute onblur does not work correctly").until(new EventFiredCondition(Event.BLUR));
}
@Test
+ public void testOnchange() {
+ selenium.type(pjq("input[type=text][id$=onchangeInput]"), "metamerEvents += \"change \"");
+ selenium.waitForPageToLoad();
+
+ String timeValue = selenium.getText(time);
+ selenium.click(inplaceInput);
+ selenium.type(input, "new value");
+ selenium.fireEvent(input, Event.BLUR);
+ waitFor(5000);
+ waitGui.failWith("Page was not updated").waitForChange(timeValue, retrieveText.locator(time));
+
+ waitGui.failWith("Attribute onchange does not work correctly").until(
+ new EventFiredCondition(new Event("change")));
+ }
+
+ @Test
public void testOnclick() {
testFireEvent(Event.CLICK, inplaceInput);
}
@@ -184,28 +208,12 @@
@Test
@IssueTracking("https://jira.jboss.org/browse/RF-9868")
public void testOnfocus() {
- testFireEvent(Event.FOCUS, inplaceInput);
- }
+ selenium.type(pjq("input[id$=onfocusInput]"), "metamerEvents += \"focus \"");
+ selenium.waitForPageToLoad(TIMEOUT);
- @Test
- public void testOninputblur() {
- testFireEvent(Event.BLUR, input, "inputblur");
- }
-
- @Test
- @IssueTracking("https://jira.jboss.org/browse/RF-9571")
- public void testOninputchange() {
- selenium.type(pjq("input[type=text][id$=oninputchangeInput]"), "metamerEvents += \"inputchange \"");
- selenium.waitForPageToLoad();
-
- String timeValue = selenium.getText(time);
selenium.click(inplaceInput);
- selenium.type(input, "new value");
- selenium.fireEvent(input, Event.BLUR);
- waitGui.failWith("Page was not updated").waitForChange(timeValue, retrieveText.locator(time));
- waitGui.failWith("Attribute oninputchange does not work correctly").until(
- new EventFiredCondition(new Event("inputchange")));
+ waitGui.failWith("Attribute onfocus does not work correctly").until(new EventFiredCondition(Event.FOCUS));
}
@Test
@@ -219,11 +227,6 @@
}
@Test
- public void testOninputfocus() {
- testFireEvent(Event.FOCUS, input, "inputfocus");
- }
-
- @Test
public void testOninputkeydown() {
testFireEvent(Event.KEYDOWN, input, "inputkeydown");
}
@@ -330,7 +333,7 @@
public void testClickOkButton() {
selenium.click(pjq("input[type=radio][name$=showControlsInput][value=true]"));
selenium.waitForPageToLoad();
-
+
String timeValue = selenium.getText(time);
selenium.click(inplaceInput);
guardNoRequest(selenium).keyPress(input, "x");
@@ -347,11 +350,11 @@
public void testClickCancelButton() {
selenium.click(pjq("input[type=radio][name$=showControlsInput][value=true]"));
selenium.waitForPageToLoad();
-
+
selenium.click(inplaceInput);
guardNoRequest(selenium).keyPress(input, "x");
guardNoRequest(selenium).mouseDown(cancelButton);
-
+
assertEquals(selenium.getText(label), "RichFaces 4", "Label");
assertEquals(selenium.getValue(input), "RichFaces 4", "Value of inplace input.");
assertEquals(selenium.getText(output), "RichFaces 4", "Output did not change.");
14 years