JBoss Rich Faces SVN: r21284 - in trunk: examples/core-demo/src/main/webapp and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: pyaschenko
Date: 2011-01-27 11:06:44 -0500 (Thu, 27 Jan 2011)
New Revision: 21284
Added:
trunk/examples/core-demo/src/main/webapp/status-myfaces.xhtml
Modified:
trunk/core/impl/src/main/resources/META-INF/resources/richfaces.js
Log:
http://jira.jboss.com/jira/browse/RF-9722
Modified: trunk/core/impl/src/main/resources/META-INF/resources/richfaces.js
===================================================================
--- trunk/core/impl/src/main/resources/META-INF/resources/richfaces.js 2011-01-27 16:02:49 UTC (rev 21283)
+++ trunk/core/impl/src/main/resources/META-INF/resources/richfaces.js 2011-01-27 16:06:44 UTC (rev 21284)
@@ -376,13 +376,22 @@
// - success
// - error
// - complete
- handlers = handlers || {};
+ var handlers = handlers || {};
+ var ignoreSuccess;
return function(eventData) {
var source = eventData.source;
//that's request status, not status control data
var status = eventData.status;
var type = eventData.type;
+
+ if (type=='event' && status=='begin') {
+ ignoreSuccess = false;
+ } else if (type=='error') {
+ ignoreSuccess = true;
+ } else if (ignoreSuccess) {
+ return;
+ }
var typeHandlers = jsfEventsAdapterEventNames[type];
var handlerNames = (typeHandlers || {})[status] || typeHandlers;
@@ -407,7 +416,6 @@
event.componentData = componentData || {};
}
}
-
handler.call(source, event);
}
}
Added: trunk/examples/core-demo/src/main/webapp/status-myfaces.xhtml
===================================================================
--- trunk/examples/core-demo/src/main/webapp/status-myfaces.xhtml (rev 0)
+++ trunk/examples/core-demo/src/main/webapp/status-myfaces.xhtml 2011-01-27 16:06:44 UTC (rev 21284)
@@ -0,0 +1,34 @@
+<?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:f="http://java.sun.com/jsf/core"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:a4j="http://richfaces.org/a4j">
+<f:view>
+ <h:head>
+ </h:head>
+ <h:body>
+
+ <a4j:status startStyle="color: green" errorStyle="color: red" onstart="RichFaces.log.info('START')"
+ onerror="RichFaces.log.info('ERROR')" onsuccess="RichFaces.log.info('SUCCESS')" onstop="RichFaces.log.info('STOP')">
+ <f:facet name="start">...start...</f:facet>
+ <f:facet name="stop">stop</f:facet>
+ <f:facet name="error">error</f:facet>
+ </a4j:status>
+
+
+ <h:form>
+ <h:commandLink value="A4J:Ajax error" action="#{statusBean.delayWithError}">
+ <a4j:ajax />
+ </h:commandLink>
+ <h:commandLink value="F:Ajax error" action="#{statusBean.delayWithError}">
+ <f:ajax />
+ </h:commandLink>
+ </h:form>
+
+ <a4j:log />
+
+ </h:body>
+</f:view>
+</html>
\ No newline at end of file
13 years, 11 months
JBoss Rich Faces SVN: r21283 - trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2011-01-27 11:02:49 -0500 (Thu, 27 Jan 2011)
New Revision: 21283
Modified:
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/AccordionItemHeaderRenderer.java
Log:
RF-10262 Accordion: two icons displayed in each item
- active and inactive icons were reversed.
Modified: trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/AccordionItemHeaderRenderer.java
===================================================================
--- trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/AccordionItemHeaderRenderer.java 2011-01-27 15:27:50 UTC (rev 21282)
+++ trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/AccordionItemHeaderRenderer.java 2011-01-27 16:02:49 UTC (rev 21283)
@@ -44,12 +44,12 @@
writer.startElement(TD_ELEM, null);
writer.writeAttribute(CLASS_ATTRIBUTE, cssClass, null);
- if (isIconRendered(attrIconCollapsedValue)) {
- encodeIdIcon(writer, context, attrIconCollapsedValue, cssIconsClassPrefix + "-act", state);
+ if (isIconRendered(attrIconExpandedValue)) {
+ encodeIdIcon(writer, context, attrIconExpandedValue, cssIconsClassPrefix + "-act", state);
}
- if (isIconRendered(attrIconExpandedValue)) {
- encodeIdIcon(writer, context, attrIconExpandedValue, cssIconsClassPrefix + "-inact", state);
+ if (isIconRendered(attrIconCollapsedValue)) {
+ encodeIdIcon(writer, context, attrIconCollapsedValue, cssIconsClassPrefix + "-inact", state);
}
writer.endElement(TD_ELEM);
13 years, 11 months
JBoss Rich Faces SVN: r21282 - modules/tests/metamer/trunk/application/src/main/webapp/components/richDropTarget.
by richfaces-svn-commits@lists.jboss.org
Author: lfryc(a)redhat.com
Date: 2011-01-27 10:27:50 -0500 (Thu, 27 Jan 2011)
New Revision: 21282
Modified:
modules/tests/metamer/trunk/application/src/main/webapp/components/richDropTarget/simple.xhtml
Log:
drag-n-drop: pre-automation activities - fixed dropTarget @id (RFPL-992)
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/richDropTarget/simple.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richDropTarget/simple.xhtml 2011-01-27 15:20:58 UTC (rev 21281)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richDropTarget/simple.xhtml 2011-01-27 15:27:50 UTC (rev 21282)
@@ -79,7 +79,7 @@
<a4j:outputPanel id="droppable1" layout="block" styleClass="metamer-droppable" style="border: 3px solid red; float: left">
<rich:dropTarget
- id="richDropTarget"
+ id="richDropTarget1"
dropValue="#{richDropTargetBean.dropValue}"
dropListener="#{richDropListenerBean.processDragging}"
action="#{richBean.dummyAction}"
13 years, 11 months
JBoss Rich Faces SVN: r21281 - in modules/tests/metamer/trunk/application/src/main: webapp/components/richDragIndicator and 3 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: lfryc(a)redhat.com
Date: 2011-01-27 10:20:58 -0500 (Thu, 27 Jan 2011)
New Revision: 21281
Modified:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichDropListenerBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichDropTargetBean.java
modules/tests/metamer/trunk/application/src/main/webapp/components/richDragIndicator/simple.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/richDragSource/simple.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/richDropTarget/simple.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/resources/css/richDragBehavior.css
Log:
drag-n-drop: pre-automation activities (RFPL-992)
Modified: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichDropListenerBean.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichDropListenerBean.java 2011-01-27 15:04:13 UTC (rev 21280)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichDropListenerBean.java 2011-01-27 15:20:58 UTC (rev 21281)
@@ -47,8 +47,13 @@
DropValue dropValue = (DropValue) dropEvent.getDropValue();
this.dropEvent = dropEvent;
+
richDropTargetBean.increaseDropValue();
- richDropTargetBean.getDroppedValues().put(dropValue, dragValue);
+ if (dropEvent.getComponent().getClientId().endsWith("1")) {
+ richDropTargetBean.getDroppedValues1().put(dropValue, dragValue);
+ } else {
+ richDropTargetBean.getDroppedValues2().put(dropValue, dragValue);
+ }
}
public DropEvent getDropEvent() {
Modified: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichDropTargetBean.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichDropTargetBean.java 2011-01-27 15:04:13 UTC (rev 21280)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichDropTargetBean.java 2011-01-27 15:20:58 UTC (rev 21281)
@@ -52,7 +52,8 @@
private static Logger logger;
private Attributes attributes;
- private Map<DropValue, DragValue> droppedValues = new LinkedHashMap<DropValue, DragValue>();
+ private Map<DropValue, DragValue> droppedValues1 = new LinkedHashMap<DropValue, DragValue>();
+ private Map<DropValue, DragValue> droppedValues2 = new LinkedHashMap<DropValue, DragValue>();
private DropValue dropValue;
private int dropValueCounter = 1;
@@ -67,7 +68,7 @@
attributes = Attributes.getComponentAttributesFromFacesConfig(UIDropTarget.class, getClass());
attributes.setAttribute("acceptedTypes", "drg1, drg2");
- attributes.setAttribute("render", "droppable");
+ attributes.setAttribute("render", "droppable1 droppable2");
attributes.setAttribute("rendered", true);
attributes.remove("actionExpression");
@@ -87,10 +88,14 @@
this.attributes = attributes;
}
- public Map<DropValue, DragValue> getDroppedValues() {
- return droppedValues;
+ public Map<DropValue, DragValue> getDroppedValues1() {
+ return droppedValues1;
}
+ public Map<DropValue, DragValue> getDroppedValues2() {
+ return droppedValues2;
+ }
+
public void increaseDropValue() {
dropValue = new DropValue(dropValueCounter++);
}
@@ -99,9 +104,15 @@
return dropValue;
}
- public List<Entry<DropValue, DragValue>> getDroppedEntries() {
- List<Entry<DropValue, DragValue>> list = new LinkedList<Entry<DropValue, DragValue>>(droppedValues.entrySet());
+ public List<Entry<DropValue, DragValue>> getDroppedEntries1() {
+ List<Entry<DropValue, DragValue>> list = new LinkedList<Entry<DropValue, DragValue>>(droppedValues1.entrySet());
Collections.reverse(list);
return list;
}
+
+ public List<Entry<DropValue, DragValue>> getDroppedEntries2() {
+ List<Entry<DropValue, DragValue>> list = new LinkedList<Entry<DropValue, DragValue>>(droppedValues2.entrySet());
+ Collections.reverse(list);
+ return list;
+ }
}
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/richDragIndicator/simple.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richDragIndicator/simple.xhtml 2011-01-27 15:04:13 UTC (rev 21280)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richDragIndicator/simple.xhtml 2011-01-27 15:20:58 UTC (rev 21281)
@@ -59,7 +59,7 @@
<table>
<tr>
<td>
- <a4j:outputPanel id="draggable1" layout="block" styleClass="draggable">
+ <a4j:outputPanel id="draggable1" layout="block" styleClass="metamer-draggable">
<h:outputText value="#1: type=#{richDragSourceBean.attributes['type'].value}" />
<rich:dragSource
dragIndicator="indicator"
@@ -68,13 +68,13 @@
</a4j:outputPanel>
</td>
<td>
- <a4j:outputPanel id="draggable2" layout="block" styleClass="draggable">
+ <a4j:outputPanel id="draggable2" layout="block" styleClass="metamer-draggable">
<h:outputText value="#2: type=drg2" />
<rich:dragSource type="drg2" dragIndicator="indicator" dragValue="#{richDragSourceBean.dragValues[1]}" />
</a4j:outputPanel>
</td>
<td>
- <a4j:outputPanel id="draggable3" layout="block" styleClass="draggable">
+ <a4j:outputPanel id="draggable3" layout="block" styleClass="metamer-draggable">
<h:outputText value="#3: type=drg3" />
<rich:dragSource type="drg3" dragIndicator="indicator" dragValue="#{richDragSourceBean.dragValues[2]}" />
</a4j:outputPanel>
@@ -82,24 +82,24 @@
</tr>
</table>
- <a4j:outputPanel id="droppable" layout="block" styleClass="droppable">
+ <a4j:outputPanel id="droppable1" layout="block" styleClass="metamer-droppable" style="float: left">
<rich:dropTarget
- id="richDropTarget"
+ id="richDropTarget1"
dropValue="#{richDropTargetBean.dropValue}"
dropListener="#{richDropListenerBean.processDragging}"
acceptedTypes="drg1, drg2"
- render="droppable"
+ render="droppable1 droppable2"
/>
<h:outputText value="Accepts: drg1, drg2" />
<br />
- <h:outputText id="dropNumber" value="Drops: #{richDropTargetBean.dropValue.number}" />
+ <h:outputText id="dropNumber1" value="Drops: #{richDropTargetBean.dropValue.number}" />
<br />
- <h:dataTable id="droppedValues" var="droppedValue" value="#{richDropTargetBean.droppedEntries}">
+ <h:dataTable id="droppedValues1" var="droppedValue" value="#{richDropTargetBean.droppedEntries1}">
<h:column>
<f:facet name="header">
Dragged
@@ -115,6 +115,40 @@
</h:dataTable>
</a4j:outputPanel>
+
+ <a4j:outputPanel id="droppable2" layout="block" styleClass="metamer-droppable">
+ <rich:dropTarget
+ id="richDropTarget2"
+ dropValue="#{richDropTargetBean.dropValue}"
+ dropListener="#{richDropListenerBean.processDragging}"
+ acceptedTypes="drg2, drg3"
+ render="droppable1 droppable2"
+ />
+
+ <h:outputText value="Accepts: drg2, drg3" />
+ <br />
+
+ <h:outputText id="dropNumber2" value="Drops: #{richDropTargetBean.dropValue.number}" />
+ <br />
+
+
+
+ <h:dataTable id="droppedValues2" var="droppedValue" value="#{richDropTargetBean.droppedEntries2}">
+ <h:column>
+ <f:facet name="header">
+ Dragged
+ </f:facet>
+ <h:outputText value="##{droppedValue.value.number}" />
+ </h:column>
+ <h:column>
+ <f:facet name="header">
+ Dropped
+ </f:facet>
+ <h:outputText value="#{droppedValue.key.number}" />
+ </h:column>
+
+ </h:dataTable>
+ </a4j:outputPanel>
</ui:define>
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/richDragSource/simple.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richDragSource/simple.xhtml 2011-01-27 15:04:13 UTC (rev 21280)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richDragSource/simple.xhtml 2011-01-27 15:20:58 UTC (rev 21281)
@@ -50,11 +50,15 @@
<ui:define name="component">
<rich:dragIndicator id="indicator" />
-
+
+ <rich:dragIndicator id="indicator2" acceptClass="acceptClass" rejectClass="rejectClass" draggingClass="draggingClass" />
+ <p>Use @indicator=indicator2 to switch to usage of second defined indicator with custom styling</p>
+
+
<table>
<tr>
<td>
- <a4j:outputPanel id="draggable1" layout="block" styleClass="draggable" style="border: 3px solid red">
+ <a4j:outputPanel id="draggable1" layout="block" styleClass="metamer-draggable" style="border: 3px solid red">
<h:outputText value="#1: type=#{richDragSourceBean.attributes['type'].value}" />
<rich:dragSource
dragValue="#{richDragSourceBean.dragValues[0]}"
@@ -64,13 +68,13 @@
</a4j:outputPanel>
</td>
<td>
- <a4j:outputPanel id="draggable2" layout="block" styleClass="draggable">
+ <a4j:outputPanel id="draggable2" layout="block" styleClass="metamer-draggable">
<h:outputText value="#2: type=drg2" />
<rich:dragSource type="drg2" dragIndicator="indicator" dragValue="#{richDragSourceBean.dragValues[1]}" />
</a4j:outputPanel>
</td>
<td>
- <a4j:outputPanel id="draggable3" layout="block" styleClass="draggable">
+ <a4j:outputPanel id="draggable3" layout="block" styleClass="metamer-draggable">
<h:outputText value="#3: type=drg3" />
<rich:dragSource type="drg3" dragIndicator="indicator" dragValue="#{richDragSourceBean.dragValues[2]}" />
</a4j:outputPanel>
@@ -78,25 +82,24 @@
</tr>
</table>
- <a4j:outputPanel id="droppable" layout="block" styleClass="droppable">
-
+ <a4j:outputPanel id="droppable1" layout="block" styleClass="metamer-droppable" style="float: left">
<rich:dropTarget
- id="richDropTarget"
- dropValue="#{richDropTargetBean.dropValue}"
- dropListener="#{richDropListenerBean.processDragging}"
- acceptedTypes="drg1, drg2"
- render="droppable"
- />
-
+ id="richDropTarget1"
+ dropValue="#{richDropTargetBean.dropValue}"
+ dropListener="#{richDropListenerBean.processDragging}"
+ acceptedTypes="drg1, drg2"
+ render="droppable1 droppable2"
+ />
+
<h:outputText value="Accepts: drg1, drg2" />
<br />
- <h:outputText id="dropNumber" value="Drops: #{richDropTargetBean.dropValue.number}" />
+ <h:outputText id="dropNumber1" value="Drops: #{richDropTargetBean.dropValue.number}" />
<br />
- <h:dataTable id="droppedValues" var="droppedValue" value="#{richDropTargetBean.droppedEntries}">
+ <h:dataTable id="droppedValues1" var="droppedValue" value="#{richDropTargetBean.droppedEntries1}">
<h:column>
<f:facet name="header">
Dragged
@@ -112,6 +115,40 @@
</h:dataTable>
</a4j:outputPanel>
+
+ <a4j:outputPanel id="droppable2" layout="block" styleClass="metamer-droppable">
+ <rich:dropTarget
+ id="richDropTarget2"
+ dropValue="#{richDropTargetBean.dropValue}"
+ dropListener="#{richDropListenerBean.processDragging}"
+ acceptedTypes="drg2, drg3"
+ render="droppable1 droppable2"
+ />
+
+ <h:outputText value="Accepts: drg2, drg3" />
+ <br />
+
+ <h:outputText id="dropNumber2" value="Drops: #{richDropTargetBean.dropValue.number}" />
+ <br />
+
+
+
+ <h:dataTable id="droppedValues2" var="droppedValue" value="#{richDropTargetBean.droppedEntries2}">
+ <h:column>
+ <f:facet name="header">
+ Dragged
+ </f:facet>
+ <h:outputText value="##{droppedValue.value.number}" />
+ </h:column>
+ <h:column>
+ <f:facet name="header">
+ Dropped
+ </f:facet>
+ <h:outputText value="#{droppedValue.key.number}" />
+ </h:column>
+
+ </h:dataTable>
+ </a4j:outputPanel>
</ui:define>
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/richDropTarget/simple.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richDropTarget/simple.xhtml 2011-01-27 15:04:13 UTC (rev 21280)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richDropTarget/simple.xhtml 2011-01-27 15:20:58 UTC (rev 21281)
@@ -54,7 +54,7 @@
<table>
<tr>
<td>
- <a4j:outputPanel id="draggable1" layout="block" styleClass="draggable">
+ <a4j:outputPanel id="draggable1" layout="block" styleClass="metamer-draggable">
<h:outputText value="#1: type=#{richDragSourceBean.attributes['type'].value}" />
<rich:dragSource
dragIndicator="indicator"
@@ -63,13 +63,13 @@
</a4j:outputPanel>
</td>
<td>
- <a4j:outputPanel id="draggable2" layout="block" styleClass="draggable">
+ <a4j:outputPanel id="draggable2" layout="block" styleClass="metamer-draggable">
<h:outputText value="#2: type=drg2" />
<rich:dragSource type="drg2" dragIndicator="indicator" dragValue="#{richDragSourceBean.dragValues[1]}" />
</a4j:outputPanel>
</td>
<td>
- <a4j:outputPanel id="draggable3" layout="block" styleClass="draggable">
+ <a4j:outputPanel id="draggable3" layout="block" styleClass="metamer-draggable">
<h:outputText value="#3: type=drg3" />
<rich:dragSource type="drg3" dragIndicator="indicator" dragValue="#{richDragSourceBean.dragValues[2]}" />
</a4j:outputPanel>
@@ -77,7 +77,7 @@
</tr>
</table>
- <a4j:outputPanel id="droppable" layout="block" styleClass="droppable" style="border: 3px solid red">
+ <a4j:outputPanel id="droppable1" layout="block" styleClass="metamer-droppable" style="border: 3px solid red; float: left">
<rich:dropTarget
id="richDropTarget"
dropValue="#{richDropTargetBean.dropValue}"
@@ -85,21 +85,21 @@
action="#{richBean.dummyAction}"
actionListener="#{richBean.dummyActionListener}"
- acceptedTypes="#{richDragSourceBean.attributes['acceptedTypes'].value}"
- bypassUpdates="#{richDragSourceBean.attributes['bypassUpdates'].value}"
- immediate="#{richDragSourceBean.attributes['immediate'].value}"
- render="#{richDragSourceBean.attributes['render'].value}"
- rendered="#{richDragSourceBean.attributes['rendered'].value}"
- value="#{richDragSourceBean.attributes['value'].value}"
+ acceptedTypes="#{richDropTargetBean.attributes['acceptedTypes'].value}"
+ bypassUpdates="#{richDropTargetBean.attributes['bypassUpdates'].value}"
+ immediate="#{richDropTargetBean.attributes['immediate'].value}"
+ render="#{richDropTargetBean.attributes['render'].value}"
+ rendered="#{richDropTargetBean.attributes['rendered'].value}"
+ value="#{richDropTargetBean.attributes['value'].value}"
/>
- <h:outputText value="Accepts: drg1, drg2" />
+ <h:outputText value="Accepts: #{richDragSourceBean.attributes['acceptedTypes'].value}" />
<br />
- <h:outputText id="dropNumber" value="Drops: #{richDropTargetBean.dropValue.number}" />
+ <h:outputText id="dropNumber1" value="Drops: #{richDropTargetBean.dropValue.number}" />
<br />
- <h:dataTable id="droppedValues" var="droppedValue" value="#{richDropTargetBean.droppedEntries}">
+ <h:dataTable id="droppedValues1" var="droppedValue" value="#{richDropTargetBean.droppedEntries1}">
<h:column>
<f:facet name="header">
Dragged
@@ -115,6 +115,40 @@
</h:dataTable>
</a4j:outputPanel>
+
+ <a4j:outputPanel id="droppable2" layout="block" styleClass="metamer-droppable">
+ <rich:dropTarget
+ id="richDropTarget2"
+ dropValue="#{richDropTargetBean.dropValue}"
+ dropListener="#{richDropListenerBean.processDragging}"
+ acceptedTypes="drg2, drg3"
+ render="droppable1 droppable2"
+ />
+
+ <h:outputText value="Accepts: drg2, drg3" />
+ <br />
+
+ <h:outputText id="dropNumber2" value="Drops: #{richDropTargetBean.dropValue.number}" />
+ <br />
+
+
+
+ <h:dataTable id="droppedValues2" var="droppedValue" value="#{richDropTargetBean.droppedEntries2}">
+ <h:column>
+ <f:facet name="header">
+ Dragged
+ </f:facet>
+ <h:outputText value="##{droppedValue.value.number}" />
+ </h:column>
+ <h:column>
+ <f:facet name="header">
+ Dropped
+ </f:facet>
+ <h:outputText value="#{droppedValue.key.number}" />
+ </h:column>
+
+ </h:dataTable>
+ </a4j:outputPanel>
</ui:define>
Modified: modules/tests/metamer/trunk/application/src/main/webapp/resources/css/richDragBehavior.css
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/resources/css/richDragBehavior.css 2011-01-27 15:04:13 UTC (rev 21280)
+++ modules/tests/metamer/trunk/application/src/main/webapp/resources/css/richDragBehavior.css 2011-01-27 15:20:58 UTC (rev 21281)
@@ -1,4 +1,4 @@
-.droppable {
+.metamer-droppable {
border: 1px solid blue;
margin: 1em;
padding: 1em;
@@ -8,7 +8,7 @@
overflow: auto;
}
-.draggable {
+.metamer-draggable {
border: 1px solid #000000;
background-color: silver;
margin: 2px;
13 years, 11 months
JBoss Rich Faces SVN: r21280 - in trunk/ui/output/ui/src: test/resources/org/richfaces/renderkit/html and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2011-01-27 10:04:13 -0500 (Thu, 27 Jan 2011)
New Revision: 21280
Modified:
trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractPanelMenu.java
trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractPanelMenuGroup.java
trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractPanelMenuItem.java
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenu-icons-inheritance-groupDis.xmlunit.xml
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenu-icons-inheritance-itemDis.xmlunit.xml
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenu-icons-inheritance-topGroupDis.xmlunit.xml
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenu-icons-inheritance-topItemDis.xmlunit.xml
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenu-icons-inheritance.xhtml
Log:
https://issues.jboss.org/browse/RF-10297
Modified: trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractPanelMenu.java
===================================================================
--- trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractPanelMenu.java 2011-01-27 14:52:21 UTC (rev 21279)
+++ trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractPanelMenu.java 2011-01-27 15:04:13 UTC (rev 21280)
@@ -237,7 +237,7 @@
public abstract String getItemClass();
@Attribute
- public abstract String getItemDisableClass();
+ public abstract String getItemDisabledClass();
@Attribute(generate = false)
public String getItemLeftIcon() {
@@ -279,7 +279,7 @@
public abstract String getTopItemClass();
@Attribute
- public abstract String getTopItemClassDisabled();
+ public abstract String getTopItemDisabledClass();
@Attribute(generate = false)
public String getTopItemLeftIcon() {
@@ -321,7 +321,7 @@
public abstract String getGroupClass();
@Attribute
- public abstract String getGroupDisableClass();
+ public abstract String getGroupDisabledClass();
@Attribute(generate = false)
public String getGroupLeftIconExpanded() {
@@ -381,7 +381,7 @@
public abstract String getTopGroupClass();
@Attribute
- public abstract String getTopGroupClassDisabled();
+ public abstract String getTopGroupDisabledClass();
@Attribute(generate = false)
public String getTopGroupLeftIconExpanded() {
Modified: trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractPanelMenuGroup.java
===================================================================
--- trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractPanelMenuGroup.java 2011-01-27 14:52:21 UTC (rev 21279)
+++ trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractPanelMenuGroup.java 2011-01-27 15:04:13 UTC (rev 21280)
@@ -265,7 +265,7 @@
@Attribute(generate = false)
public String getDisabledClass() {
return (String) getStateHelper().eval(Properties.disabledClass,
- isTopItem() ? getPanelMenu().getTopGroupClassDisabled() : getPanelMenu().getGroupDisableClass());
+ isTopItem() ? getPanelMenu().getTopGroupDisabledClass() : getPanelMenu().getGroupDisabledClass());
}
public void setDisabledClass(String disabledClass) {
Modified: trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractPanelMenuItem.java
===================================================================
--- trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractPanelMenuItem.java 2011-01-27 14:52:21 UTC (rev 21279)
+++ trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractPanelMenuItem.java 2011-01-27 15:04:13 UTC (rev 21280)
@@ -23,11 +23,15 @@
package org.richfaces.component;
+import javax.faces.component.UIComponent;
+
import org.richfaces.PanelMenuMode;
-import org.richfaces.cdk.annotations.*;
+import org.richfaces.cdk.annotations.Attribute;
+import org.richfaces.cdk.annotations.EventName;
+import org.richfaces.cdk.annotations.JsfComponent;
+import org.richfaces.cdk.annotations.Tag;
+import org.richfaces.cdk.annotations.TagType;
-import javax.faces.component.UIComponent;
-
/**
* @author akolonitsky
* @since 2010-10-25
@@ -131,7 +135,7 @@
@Attribute(generate = false)
public String getDisabledClass() {
return (String) getStateHelper().eval(Properties.disabledClass,
- isTopItem() ? getPanelMenu().getTopItemClassDisabled() : getPanelMenu().getItemDisableClass());
+ isTopItem() ? getPanelMenu().getTopItemDisabledClass() : getPanelMenu().getItemDisabledClass());
}
public void setDisabledClass(String disabledClass) {
Modified: trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenu-icons-inheritance-groupDis.xmlunit.xml
===================================================================
--- trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenu-icons-inheritance-groupDis.xmlunit.xml 2011-01-27 14:52:21 UTC (rev 21279)
+++ trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenu-icons-inheritance-groupDis.xmlunit.xml 2011-01-27 15:04:13 UTC (rev 21280)
@@ -1,4 +1,4 @@
-<div id="f:panelMenuGroup-dis" class="rf-pm-gr groupClass rf-pm-gr-dis groupDisableClass">
+<div id="f:panelMenuGroup-dis" class="rf-pm-gr groupClass rf-pm-gr-dis groupDisabledClass">
<input id="f:panelMenuGroup-dis:expanded" name="f:panelMenuGroup-dis:expanded" type="hidden" value="false"/>
<div id="f:panelMenuGroup-dis:hdr" class="rf-pm-gr-hdr rf-pm-hdr-colps rf-pm-gr-hdr-dis">
<table class="rf-pm-gr-gr">
Modified: trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenu-icons-inheritance-itemDis.xmlunit.xml
===================================================================
--- trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenu-icons-inheritance-itemDis.xmlunit.xml 2011-01-27 14:52:21 UTC (rev 21279)
+++ trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenu-icons-inheritance-itemDis.xmlunit.xml 2011-01-27 15:04:13 UTC (rev 21280)
@@ -1,4 +1,4 @@
-<div id="f:panelMenuItem-dis" class="rf-pm-itm itemClass rf-pm-itm-dis itemDisableClass">
+<div id="f:panelMenuItem-dis" class="rf-pm-itm itemClass rf-pm-itm-dis itemDisabledClass">
<table class="rf-pm-itm-gr">
<tbody>
<tr>
Modified: trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenu-icons-inheritance-topGroupDis.xmlunit.xml
===================================================================
--- trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenu-icons-inheritance-topGroupDis.xmlunit.xml 2011-01-27 14:52:21 UTC (rev 21279)
+++ trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenu-icons-inheritance-topGroupDis.xmlunit.xml 2011-01-27 15:04:13 UTC (rev 21280)
@@ -1,4 +1,4 @@
-<div id="f:panelMenuGroup-topDis" class="rf-pm-top-gr topGroupClass rf-pm-top-gr-dis topGroupClassDisabled">
+<div id="f:panelMenuGroup-topDis" class="rf-pm-top-gr topGroupClass rf-pm-top-gr-dis topGroupDisabledClass">
<input id="f:panelMenuGroup-topDis:expanded" name="f:panelMenuGroup-topDis:expanded" type="hidden" value="false"/>
<div id="f:panelMenuGroup-topDis:hdr" class="rf-pm-top-gr-hdr rf-pm-hdr-colps rf-pm-top-gr-hdr-dis">
<table class="rf-pm-top-gr-gr">
Modified: trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenu-icons-inheritance-topItemDis.xmlunit.xml
===================================================================
--- trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenu-icons-inheritance-topItemDis.xmlunit.xml 2011-01-27 14:52:21 UTC (rev 21279)
+++ trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenu-icons-inheritance-topItemDis.xmlunit.xml 2011-01-27 15:04:13 UTC (rev 21280)
@@ -1,4 +1,4 @@
-<div id="f:panelMenuItem-topDis" class="rf-pm-top-itm topItemClass rf-pm-top-itm-dis topItemClassDisabled">
+<div id="f:panelMenuItem-topDis" class="rf-pm-top-itm topItemClass rf-pm-top-itm-dis topItemDisabledClass">
<table class="rf-pm-top-itm-gr">
<tbody>
<tr>
Modified: trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenu-icons-inheritance.xhtml
===================================================================
--- trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenu-icons-inheritance.xhtml 2011-01-27 14:52:21 UTC (rev 21279)
+++ trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/panelMenu-icons-inheritance.xhtml 2011-01-27 15:04:13 UTC (rev 21280)
@@ -44,7 +44,7 @@
itemRightIconDisabled="chevronUp"
itemLeftIconDisabled="chevronDown"
- itemDisableClass="itemDisableClass"
+ itemDisabledClass="itemDisabledClass"
topItemRightIcon="triangle"
topItemLeftIcon="triangle"
@@ -52,7 +52,7 @@
topItemRightIconDisabled="chevron"
topItemLeftIconDisabled="chevron"
- topItemClassDisabled="topItemClassDisabled"
+ topItemDisabledClass="topItemDisabledClass"
groupRightIconCollapsed="triangleUp"
groupRightIconExpanded="disc"
@@ -62,7 +62,7 @@
groupRightIconDisabled="chevronUp"
groupLeftIconDisabled="chevronDown"
- groupDisableClass="groupDisableClass"
+ groupDisabledClass="groupDisabledClass"
topGroupRightIconCollapsed="triangle"
topGroupRightIconExpanded="disc"
@@ -72,7 +72,7 @@
topGroupRightIconDisabled="chevron"
topGroupLeftIconDisabled="chevron"
- topGroupClassDisabled="topGroupClassDisabled"
+ topGroupDisabledClass="topGroupDisabledClass"
>
<pn:panelMenuGroup id="panelMenuGroup-top"></pn:panelMenuGroup>
13 years, 11 months
JBoss Rich Faces SVN: r21279 - in modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest: richMenuGroup and 3 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: ppitonak(a)redhat.com
Date: 2011-01-27 09:52:21 -0500 (Thu, 27 Jan 2011)
New Revision: 21279
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInputNumberSlider/TestRichSlider.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richMenuGroup/TestRichMenuGroup.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richMenuItem/TestRichMenuItem.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPopupPanel/TestRichPopupPanel.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richSelect/TestRichSelect.java
Log:
* failing tests fixed
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInputNumberSlider/TestRichSlider.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInputNumberSlider/TestRichSlider.java 2011-01-27 14:08:35 UTC (rev 21278)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInputNumberSlider/TestRichSlider.java 2011-01-27 14:52:21 UTC (rev 21279)
@@ -231,7 +231,7 @@
}
@Test
- @Use(field = "delay", ints = {600, 1250, 3700})
+ @Use(field = "delay", ints = {800, 1250, 3700})
public void testDelay() {
selenium.type(pjq("input[type=text][id$=delayInput]"), delay.toString());
selenium.waitForPageToLoad();
@@ -290,6 +290,7 @@
}
@Test
+ @IssueTracking("https://issues.jboss.org/browse/RF-10048")
public void testImmediate() {
selenium.click(pjq("input[type=radio][name$=immediateInput][value=true]"));
selenium.waitForPageToLoad();
@@ -671,7 +672,7 @@
selenium.mouseDown(arrow);
- for (int i = 0; i < 12; i++) {
+ for (int i = 0; i < 14; i++) {
timesSet.add(selenium.getText(time));
waitFor(delta);
}
@@ -686,10 +687,17 @@
}
delta = (long) (delay * 0.5);
- for (int i = 1; i < timesArray.length - 1; i++) {
- long diff = timesArray[i + 1].getTime() - timesArray[i].getTime();
- assertTrue(Math.abs(diff - delay) < delta, "Delay " + diff + " is too far from set value (" + delay + ")");
+ long average = countAverage(timesArray);
+ assertTrue(Math.abs(average - delay) < delta, "Average delay " + average + " is too far from set value (" + delay + ")");
+ assertFalse(average < delay, "Average interval " + average + " cannot be smaller than set value (" + delay + ")");
+ }
+
+ private long countAverage(Date[] times) {
+ long total = 0L;
+ for (int i = 1; i < times.length - 1; i++) {
+ total += (times[i].getTime() - times[i + 1].getTime());
}
+ return Math.abs(total / (times.length - 2));
}
}
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richMenuGroup/TestRichMenuGroup.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richMenuGroup/TestRichMenuGroup.java 2011-01-27 14:08:35 UTC (rev 21278)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richMenuGroup/TestRichMenuGroup.java 2011-01-27 14:52:21 UTC (rev 21279)
@@ -49,6 +49,7 @@
public class TestRichMenuGroup extends AbstractMetamerTest {
private JQueryLocator fileMenu = pjq("div[id$=menu1]");
+ private JQueryLocator fileMenuLabel = pjq("div[id$=menu1_label]");
private JQueryLocator fileMenuList = pjq("div[id$=menu1_list]");
private JQueryLocator group = pjq("div[id$=menuGroup4]");
private JQueryLocator groupList = pjq("div[id$=menuGroup4_list]");
@@ -71,7 +72,7 @@
assertFalse(selenium.isVisible(group), "Menu group \"Save As...\" should not be visible on the page.");
assertFalse(selenium.isDisplayed(fileMenuList), "Menu should not be expanded.");
- guardNoRequest(selenium).mouseOver(fileMenu);
+ guardNoRequest(selenium).mouseOver(fileMenuLabel);
assertTrue(selenium.isDisplayed(fileMenuList), "Menu should be expanded.");
assertTrue(selenium.isElementPresent(group), "Menu group \"Save As...\" should be present on the page.");
@@ -193,7 +194,7 @@
selenium.type(pjq("input[id$=onhideInput]"), "metamerEvents += \"hide \"");
selenium.waitForPageToLoad(TIMEOUT);
- selenium.mouseOver(fileMenu);
+ selenium.mouseOver(fileMenuLabel);
waitGui.failWith("Menu was not open.").until(isDisplayed.locator(fileMenuList));
selenium.mouseOver(group);
waitGui.failWith("Submenu was not open").until(isDisplayed.locator(groupList));
@@ -247,7 +248,7 @@
selenium.type(pjq("input[id$=onshowInput]"), "metamerEvents += \"show \"");
selenium.waitForPageToLoad(TIMEOUT);
- selenium.mouseOver(fileMenu);
+ selenium.mouseOver(fileMenuLabel);
waitGui.failWith("Menu was not open.").until(isDisplayed.locator(fileMenuList));
selenium.mouseOver(group);
waitGui.failWith("Submenu was not open").until(isDisplayed.locator(groupList));
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richMenuItem/TestRichMenuItem.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richMenuItem/TestRichMenuItem.java 2011-01-27 14:08:35 UTC (rev 21278)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richMenuItem/TestRichMenuItem.java 2011-01-27 14:52:21 UTC (rev 21279)
@@ -55,6 +55,7 @@
public class TestRichMenuItem extends AbstractMetamerTest {
private JQueryLocator fileMenu = pjq("div[id$=menu1]");
+ private JQueryLocator fileMenuLabel = pjq("div[id$=menu1_label]");
private JQueryLocator menuItem1 = pjq("div[id$=menuItem1]");
private JQueryLocator image = menuItem1.getDescendant(jq("img"));
private JQueryLocator label = menuItem1.getDescendant(jq("span.rf-ddm-itm-lbl"));
@@ -74,7 +75,7 @@
assertTrue(selenium.isElementPresent(menuItem1), "Menu item \"New\" should be present on the page.");
assertFalse(selenium.isVisible(menuItem1), "Menu item \"New\" should not be visible on the page.");
- guardNoRequest(selenium).mouseOver(fileMenu);
+ guardNoRequest(selenium).mouseOver(fileMenuLabel);
assertTrue(selenium.isElementPresent(menuItem1), "Menu item \"New\" should be present on the page.");
assertTrue(selenium.isVisible(menuItem1), "Menu item \"New\" should be visible on the page.");
@@ -110,7 +111,7 @@
@Test
public void testActionListener() {
String reqTime = selenium.getText(time);
- selenium.mouseOver(fileMenu);
+ selenium.mouseOver(fileMenuLabel);
guardXhr(selenium).click(menuItem1);
waitGui.failWith("Page was not updated").waitForChange(reqTime, retrieveText.locator(time));
@@ -124,7 +125,7 @@
selenium.waitForPageToLoad();
String reqTime = selenium.getText(time);
- selenium.mouseOver(fileMenu);
+ selenium.mouseOver(fileMenuLabel);
guardXhr(selenium).click(menuItem1);
waitGui.failWith("Page was not updated").waitForChange(reqTime, retrieveText.locator(time));
@@ -146,7 +147,7 @@
selenium.waitForPageToLoad();
String reqTime = selenium.getText(time);
- selenium.mouseOver(fileMenu);
+ selenium.mouseOver(fileMenuLabel);
guardXhr(selenium).click(menuItem1);
waitGui.failWith("Page was not updated").waitForChange(reqTime, retrieveText.locator(time));
@@ -175,7 +176,7 @@
selenium.waitForPageToLoad();
String reqTime = selenium.getText(time);
- selenium.mouseOver(fileMenu);
+ selenium.mouseOver(fileMenuLabel);
guardXhr(selenium).click(menuItem1);
waitGui.failWith("Page was not updated").waitForChange(reqTime, retrieveText.locator(time));
@@ -232,7 +233,7 @@
selenium.waitForPageToLoad();
String reqTime = selenium.getText(time);
- selenium.mouseOver(fileMenu);
+ selenium.mouseOver(fileMenuLabel);
guardXhr(selenium).click(menuItem1);
waitGui.failWith("Page was not updated").waitForChange(reqTime, retrieveText.locator(time));
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPopupPanel/TestRichPopupPanel.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPopupPanel/TestRichPopupPanel.java 2011-01-27 14:08:35 UTC (rev 21278)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richPopupPanel/TestRichPopupPanel.java 2011-01-27 14:52:21 UTC (rev 21279)
@@ -237,7 +237,7 @@
@Test
public void testLeft() {
- double width = Integer.parseInt(selenium.getEval(new JavaScript("window.document.body.clientWidth")));
+ double width = Integer.parseInt(selenium.getEval(new JavaScript("window.innerWidth")));
width = (width - 500) / 2;
selenium.click(openButton);
waitGui.failWith("Panel was not opened.").until(isDisplayed.locator(panel));
@@ -479,10 +479,11 @@
@Test
public void testTop() {
- double top = Integer.parseInt(selenium.getEval(new JavaScript("window.document.body.clientHeight")));
+ double top = Integer.parseInt(selenium.getEval(new JavaScript("window.innerHeight")));
top = (top - 300) / 2;
selenium.click(openButton);
waitGui.failWith("Panel was not opened.").until(isDisplayed.locator(panel));
+ waitFor(6000);
assertEquals(selenium.getElementPositionTop(panelContainer), Math.round(top), "Top margin of the panel");
selenium.type(pjq("input[id$=topInput]"), "200");
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-01-27 14:08:35 UTC (rev 21278)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richSelect/TestRichSelect.java 2011-01-27 14:52:21 UTC (rev 21279)
@@ -400,6 +400,7 @@
selenium.focus(input);
selenium.keyPressNative("40"); // arrow down
selenium.keyPressNative("40"); // arrow down
+ waitModel.withDelay(true).failWith("Popup did not show").until(isDisplayed.locator(popup));
assertTrue(selenium.belongsClass(options.format(0), "metamer-ftest-class"), "Selected item does not contain defined class.");
for (int i = 1; i < 50; i++) {
13 years, 11 months
JBoss Rich Faces SVN: r21278 - trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2011-01-27 09:08:35 -0500 (Thu, 27 Jan 2011)
New Revision: 21278
Modified:
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/TableIconsRendererHelper.java
Log:
RF-10262 Accordion: two icons displayed in each item
Modified: trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/TableIconsRendererHelper.java
===================================================================
--- trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/TableIconsRendererHelper.java 2011-01-27 14:00:38 UTC (rev 21277)
+++ trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/TableIconsRendererHelper.java 2011-01-27 14:08:35 UTC (rev 21278)
@@ -117,7 +117,7 @@
if (icon != null) {
encodeDivIcon(writer, icon, styleClass, state);
} else {
- encodeImage(writer, context, attrIconValue);
+ encodeImage(writer, context, attrIconValue, styleClass);
}
}
}
@@ -128,9 +128,10 @@
writer.endElement(DIV_ELEM);
}
- public static void encodeImage(ResponseWriter writer, FacesContext context, String attrIconValue) throws IOException {
+ public static void encodeImage(ResponseWriter writer, FacesContext context, String attrIconValue, String styleClass) throws IOException {
writer.startElement(IMG_ELEMENT, null);
writer.writeAttribute(ALT_ATTRIBUTE, "", null);
+ writer.writeAttribute(CLASS_ATTRIBUTE, styleClass, null);
writer.writeURIAttribute(SRC_ATTRIBUTE, RenderKitUtils.getResourceURL(attrIconValue, context), null);
writer.endElement(IMG_ELEMENT);
}
13 years, 11 months
JBoss Rich Faces SVN: r21277 - trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2011-01-27 09:00:38 -0500 (Thu, 27 Jan 2011)
New Revision: 21277
Modified:
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/togglePanelItem.js
Log:
https://issues.jboss.org/browse/RF-10112
Modified: trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/togglePanelItem.js
===================================================================
--- trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/togglePanelItem.js 2011-01-27 13:18:22 UTC (rev 21276)
+++ trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/togglePanelItem.js 2011-01-27 14:00:38 UTC (rev 21277)
@@ -127,7 +127,9 @@
// class stuff
destroy: function () {
var parent = this.getTogglePanel();
- delete parent.getItems()[this.index];
+ if (parent) {
+ delete parent.getItems()[this.index];
+ }
$super.destroy.call(this);
}
13 years, 11 months
JBoss Rich Faces SVN: r21276 - in modules/tests/metamer/trunk: application/src/main/resources/org/richfaces/tests/metamer/bean and 3 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: ppitonak(a)redhat.com
Date: 2011-01-27 08:18:22 -0500 (Thu, 27 Jan 2011)
New Revision: 21276
Modified:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichCollapsiblePanelBean.java
modules/tests/metamer/trunk/application/src/main/resources/org/richfaces/tests/metamer/bean/RichCollapsiblePanelBean.properties
modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsiblePanel/facets.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsiblePanel/list.xhtml
modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsiblePanel/simple.xhtml
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/richCollapsiblePanel/TestRichCollapsiblePanel.java
Log:
https://issues.jboss.org/browse/RFPL-836
* samples for collapsible panel fixed
* added 24 new tests for collapsible panel
Modified: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichCollapsiblePanelBean.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichCollapsiblePanelBean.java 2011-01-27 13:16:30 UTC (rev 21275)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichCollapsiblePanelBean.java 2011-01-27 13:18:22 UTC (rev 21276)
@@ -22,9 +22,11 @@
package org.richfaces.tests.metamer.bean;
import java.io.Serializable;
+
import javax.annotation.PostConstruct;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ViewScoped;
+
import org.richfaces.component.UICollapsiblePanel;
import org.richfaces.event.PanelToggleEvent;
import org.richfaces.tests.metamer.Attributes;
@@ -58,13 +60,11 @@
attributes.setAttribute("rendered", true);
attributes.setAttribute("header", "collapsible panel header");
- // TODO has to be tested in another way
- attributes.remove("changeExpandListener");
+ // will be tested in another way
attributes.remove("converter");
- attributes.remove("itemChangeListener");
- // hidden attributes
- attributes.remove("changeExpandListeners");
+ // TODO remove as soon as it is added to taglib RF-10310
+ attributes.setAttribute("onbegin", null);
}
public Attributes getAttributes() {
Modified: modules/tests/metamer/trunk/application/src/main/resources/org/richfaces/tests/metamer/bean/RichCollapsiblePanelBean.properties
===================================================================
--- modules/tests/metamer/trunk/application/src/main/resources/org/richfaces/tests/metamer/bean/RichCollapsiblePanelBean.properties 2011-01-27 13:16:30 UTC (rev 21275)
+++ modules/tests/metamer/trunk/application/src/main/resources/org/richfaces/tests/metamer/bean/RichCollapsiblePanelBean.properties 2011-01-27 13:18:22 UTC (rev 21276)
@@ -1,3 +1,55 @@
+attr.dir.ltr=ltr
+attr.dir.rtl=rtl
+attr.dir.null=
+
+attr.leftIconCollapsed.none=none
+attr.leftIconCollapsed.grid=grid
+attr.leftIconCollapsed.disc=disc
+attr.leftIconCollapsed.chevronUp=chevronUp
+attr.leftIconCollapsed.chevronDown=chevronDown
+attr.leftIconCollapsed.triangle=triangle
+attr.leftIconCollapsed.triangleUp=triangleUp
+attr.leftIconCollapsed.triangleDown=triangleDown
+attr.leftIconCollapsed.star=/resources/images/star.png
+attr.leftIconCollapsed.nonexisting=nonexisting
+attr.leftIconCollapsed.null=
+
+attr.leftIconExpanded.none=none
+attr.leftIconExpanded.grid=grid
+attr.leftIconExpanded.disc=disc
+attr.leftIconExpanded.chevronUp=chevronUp
+attr.leftIconExpanded.chevronDown=chevronDown
+attr.leftIconExpanded.triangle=triangle
+attr.leftIconExpanded.triangleUp=triangleUp
+attr.leftIconExpanded.triangleDown=triangleDown
+attr.leftIconExpanded.star=/resources/images/star.png
+attr.leftIconExpanded.nonexisting=nonexisting
+attr.leftIconExpanded.null=
+
+attr.rightIconCollapsed.none=none
+attr.rightIconCollapsed.grid=grid
+attr.rightIconCollapsed.disc=disc
+attr.rightIconCollapsed.chevronUp=chevronUp
+attr.rightIconCollapsed.chevronDown=chevronDown
+attr.rightIconCollapsed.triangle=triangle
+attr.rightIconCollapsed.triangleUp=triangleUp
+attr.rightIconCollapsed.triangleDown=triangleDown
+attr.rightIconCollapsed.star=/resources/images/star.png
+attr.rightIconCollapsed.nonexisting=nonexisting
+attr.rightIconCollapsed.null=
+
+attr.rightIconExpanded.none=none
+attr.rightIconExpanded.grid=grid
+attr.rightIconExpanded.disc=disc
+attr.rightIconExpanded.chevronUp=chevronUp
+attr.rightIconExpanded.chevronDown=chevronDown
+attr.rightIconExpanded.triangle=triangle
+attr.rightIconExpanded.triangleUp=triangleUp
+attr.rightIconExpanded.triangleDown=triangleDown
+attr.rightIconExpanded.star=/resources/images/star.png
+attr.rightIconExpanded.nonexisting=nonexisting
+attr.rightIconExpanded.null=
+
attr.switchType.client=client
attr.switchType.server=server
attr.switchType.ajax=ajax
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsiblePanel/facets.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsiblePanel/facets.xhtml 2011-01-27 13:16:30 UTC (rev 21275)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsiblePanel/facets.xhtml 2011-01-27 13:18:22 UTC (rev 21276)
@@ -6,7 +6,7 @@
<!--
JBoss, Home of Professional Open Source
-Copyright 2010, Red Hat, Inc. and individual contributors
+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.
@@ -54,9 +54,12 @@
headerControlClass="#{richCollapsiblePanelBean.attributes['headerControlClass'].value}"
immediate="#{richCollapsiblePanelBean.attributes['immediate'].value}"
lang="#{richCollapsiblePanelBean.attributes['lang'].value}"
+ leftIconCollapsed="#{richCollapsiblePanelBean.attributes['leftIconCollapsed'].value}"
+ leftIconExpanded="#{richCollapsiblePanelBean.attributes['leftIconExpanded'].value}"
limitRender="#{richCollapsiblePanelBean.attributes['limitRender'].value}"
onbeforedomupdate="#{richCollapsiblePanelBean.attributes['onbeforedomupdate'].value}"
onbeforeswitch="#{richCollapsiblePanelBean.attributes['onbeforeswitch'].value}"
+ onbegin="#{richCollapsiblePanelBean.attributes['onbegin'].value}"
onclick="#{richCollapsiblePanelBean.attributes['onclick'].value}"
oncomplete="#{richCollapsiblePanelBean.attributes['oncomplete'].value}"
ondblclick="#{richCollapsiblePanelBean.attributes['ondblclick'].value}"
@@ -68,6 +71,8 @@
onswitch="#{richCollapsiblePanelBean.attributes['onswitch'].value}"
render="#{richCollapsiblePanelBean.attributes['render'].value}"
rendered="#{richCollapsiblePanelBean.attributes['rendered'].value}"
+ rightIconCollapsed="#{richCollapsiblePanelBean.attributes['rightIconCollapsed'].value}"
+ rightIconExpanded="#{richCollapsiblePanelBean.attributes['rightIconExpanded'].value}"
status="#{richCollapsiblePanelBean.attributes['status'].value}"
style="#{richCollapsiblePanelBean.attributes['style'].value}"
styleClass="#{richCollapsiblePanelBean.attributes['styleClass'].value}"
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsiblePanel/list.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsiblePanel/list.xhtml 2011-01-27 13:16:30 UTC (rev 21275)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsiblePanel/list.xhtml 2011-01-27 13:18:22 UTC (rev 21276)
@@ -5,7 +5,7 @@
<!--
JBoss, Home of Professional Open Source
-Copyright 2010, Red Hat, Inc. and individual contributors
+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.
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsiblePanel/simple.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsiblePanel/simple.xhtml 2011-01-27 13:16:30 UTC (rev 21275)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsiblePanel/simple.xhtml 2011-01-27 13:18:22 UTC (rev 21276)
@@ -6,7 +6,7 @@
<!--
JBoss, Home of Professional Open Source
-Copyright 2010, Red Hat, Inc. and individual contributors
+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.
@@ -40,7 +40,7 @@
</ui:define>
<ui:define name="component">
-
+
<rich:collapsiblePanel id="collapsiblePanel"
bodyClass="#{richCollapsiblePanelBean.attributes['bodyClass'].value}"
bypassUpdates="#{richCollapsiblePanelBean.attributes['bypassUpdates'].value}"
@@ -53,9 +53,12 @@
headerControlClass="#{richCollapsiblePanelBean.attributes['headerControlClass'].value}"
immediate="#{richCollapsiblePanelBean.attributes['immediate'].value}"
lang="#{richCollapsiblePanelBean.attributes['lang'].value}"
+ leftIconCollapsed="#{richCollapsiblePanelBean.attributes['leftIconCollapsed'].value}"
+ leftIconExpanded="#{richCollapsiblePanelBean.attributes['leftIconExpanded'].value}"
limitRender="#{richCollapsiblePanelBean.attributes['limitRender'].value}"
onbeforedomupdate="#{richCollapsiblePanelBean.attributes['onbeforedomupdate'].value}"
onbeforeswitch="#{richCollapsiblePanelBean.attributes['onbeforeswitch'].value}"
+ onbegin="#{richCollapsiblePanelBean.attributes['onbegin'].value}"
onclick="#{richCollapsiblePanelBean.attributes['onclick'].value}"
oncomplete="#{richCollapsiblePanelBean.attributes['oncomplete'].value}"
ondblclick="#{richCollapsiblePanelBean.attributes['ondblclick'].value}"
@@ -67,6 +70,8 @@
onswitch="#{richCollapsiblePanelBean.attributes['onswitch'].value}"
render="#{richCollapsiblePanelBean.attributes['render'].value}"
rendered="#{richCollapsiblePanelBean.attributes['rendered'].value}"
+ rightIconCollapsed="#{richCollapsiblePanelBean.attributes['rightIconCollapsed'].value}"
+ rightIconExpanded="#{richCollapsiblePanelBean.attributes['rightIconExpanded'].value}"
status="#{richCollapsiblePanelBean.attributes['status'].value}"
style="#{richCollapsiblePanelBean.attributes['style'].value}"
styleClass="#{richCollapsiblePanelBean.attributes['styleClass'].value}"
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 2011-01-27 13:16:30 UTC (rev 21275)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/AbstractMetamerTest.java 2011-01-27 13:18:22 UTC (rev 21276)
@@ -68,12 +68,14 @@
public abstract class AbstractMetamerTest extends AbstractTestCase {
protected JQueryLocator time = jq("span[id$=requestTime]");
+ protected JQueryLocator renderChecker = jq("span[id$=renderChecker]");
+ protected JQueryLocator statusChecker = jq("span[id$=statusCheckerOutput]");
protected TextRetriever retrieveRequestTime = retrieveText.locator(time);
protected Retriever<String> retrieveWindowData = new ScriptEvaluationRetriever().script(js("window.data"));
protected TextRetriever retrieveRenderChecker = retrieveText.locator(jq("#renderChecker"));
protected TextRetriever retrieveStatusChecker = retrieveText.locator(jq("#statusCheckerOutput"));
protected PhaseInfo phaseInfo = new PhaseInfo();
-
+
/**
* timeout in miliseconds
*/
@@ -242,7 +244,7 @@
assertTrue(selenium.isElementPresent(element));
assertFalse(selenium.isElementPresent(elementWhichHasntThatClass));
}
-
+
public void testRequestEventsBefore(String... events) {
for (String event : events) {
selenium.type(pjq(format("input[type=text][id$=on{0}Input]", event)), format("metamerEvents += \"{0} \"", event));
@@ -253,7 +255,7 @@
retrieveRequestTime.initializeValue();
}
-
+
public void testRequestEventsAfter(String... events) {
waitGui.failWith("Page was not updated").waitForChange(retrieveRequestTime);
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richCollapsiblePanel/TestRichCollapsiblePanel.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richCollapsiblePanel/TestRichCollapsiblePanel.java 2011-01-27 13:16:30 UTC (rev 21275)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richCollapsiblePanel/TestRichCollapsiblePanel.java 2011-01-27 13:18:22 UTC (rev 21276)
@@ -1,6 +1,6 @@
/*******************************************************************************
* JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat, Inc. and individual contributors
+ * 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.
*
@@ -24,15 +24,22 @@
import static org.jboss.test.selenium.guard.request.RequestTypeGuardFactory.guardHttp;
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.locator.option.OptionLocatorFactory.optionLabel;
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 static org.testng.Assert.fail;
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.encapsulated.JavaScript;
+import org.jboss.test.selenium.locator.Attribute;
import org.jboss.test.selenium.locator.JQueryLocator;
import org.richfaces.tests.metamer.ftest.AbstractMetamerTest;
import org.richfaces.tests.metamer.ftest.annotations.IssueTracking;
@@ -47,11 +54,13 @@
public class TestRichCollapsiblePanel extends AbstractMetamerTest {
private JQueryLocator panel = pjq("div[id$=collapsiblePanel]");
- private JQueryLocator header = pjq("div[id$=collapsiblePanel:header] div.rf-cp-lbl-exp");
+ private JQueryLocator header = pjq("div[id$=collapsiblePanel:header]");
private JQueryLocator headerExp = pjq("div[id$=collapsiblePanel:header] div.rf-cp-lbl-exp");
private JQueryLocator headerColps = pjq("div[id$=collapsiblePanel:header] div.rf-cp-lbl-colps");
private JQueryLocator content = pjq("div[id$=collapsiblePanel:content]");
-
+ private JQueryLocator leftIcon = pjq("td.rf-cp-ico");
+ private JQueryLocator rightIcon = pjq("td.rf-cp-exp-ico");
+
@Override
public URL getTestUrl() {
return buildUrl(contextPath, "faces/components/richCollapsiblePanel/simple.xhtml");
@@ -66,70 +75,75 @@
}
@Test
- public void testSwitchTypeNull() {
- // click to collapse
- String timeValue = selenium.getText(time);
- guardXhr(selenium).click(header);
- waitGui.failWith("Page was not updated").waitForChange(timeValue, retrieveText.locator(time));
+ public void testBodyClass() {
+ testStyleClass(content, "bodyClass");
+ }
- verifyAfterClick();
+ @Test
+ @IssueTracking("https://issues.jboss.org/browse/RF-10054")
+ public void testBypassUpdates() {
+ selenium.click(pjq("input[type=radio][name$=bypassUpdatesInput][value=true]"));
+ selenium.waitForPageToLoad();
- // click to expand
- timeValue = selenium.getText(time);
+ String reqTime = selenium.getText(time);
guardXhr(selenium).click(header);
- waitGui.failWith("Page was not updated").waitForChange(timeValue, retrieveText.locator(time));
+ waitGui.failWith("Page was not updated").waitForChange(reqTime, retrieveText.locator(time));
- verifyBeforeClick();
+ phaseInfo.assertPhases(PhaseId.RESTORE_VIEW, PhaseId.APPLY_REQUEST_VALUES, PhaseId.PROCESS_VALIDATIONS,
+ PhaseId.RENDER_RESPONSE);
+ phaseInfo.assertListener(PhaseId.APPLY_REQUEST_VALUES, "panel collapsed");
}
@Test
- public void testSwitchTypeAjax() {
- selenium.click(pjq("input[name$=switchTypeInput][value=ajax]"));
+ @IssueTracking("https://issues.jboss.org/browse/RF-10061")
+ public void testData() {
+ selenium.type(pjq("input[type=text][id$=dataInput]"), "RichFaces 4");
selenium.waitForPageToLoad();
- testSwitchTypeNull();
- }
-
- @Test
- public void testSwitchTypeClient() {
- selenium.click(pjq("input[name$=switchTypeInput][value=client]"));
+ selenium.type(pjq("input[type=text][id$=oncompleteInput]"), "data = event.data");
selenium.waitForPageToLoad();
- // click to collapse
- guardNoRequest(selenium).click(header);
- verifyAfterClick();
+ String reqTime = selenium.getText(time);
+ guardXhr(selenium).click(header);
+ waitGui.failWith("Page was not updated").waitForChange(reqTime, retrieveText.locator(time));
- // click to expand
- guardNoRequest(selenium).click(header);
- verifyBeforeClick();
+ String data = selenium.getEval(new JavaScript("window.data"));
+ assertEquals(data, "RichFaces 4", "Data sent with ajax request");
}
@Test
- public void testSwitchTypeServer() {
- selenium.click(pjq("input[name$=switchTypeInput][value=server]"));
+ public void testDir() {
+ testDir(panel);
+ }
+
+ @Test
+ public void testExecute() {
+ selenium.type(pjq("input[type=text][id$=executeInput]"), "input executeChecker");
selenium.waitForPageToLoad();
- // click to collapse
- guardHttp(selenium).click(header);
- verifyAfterClick();
+ String reqTime = selenium.getText(time);
+ guardXhr(selenium).click(header);
+ waitGui.failWith("Page was not updated").waitForChange(reqTime, retrieveText.locator(time));
- // click to expand
- guardHttp(selenium).click(header);
- verifyBeforeClick();
+ JQueryLocator logItems = jq("ul.phases-list li:eq({0})");
+ for (int i = 0; i < 6; i++) {
+ if ("* executeChecker".equals(selenium.getText(logItems.format(i)))) {
+ return;
+ }
+ }
+
+ fail("Attribute execute does not work");
}
@Test
- @IssueTracking("https://issues.jboss.org/browse/RF-10054")
- public void testBypassUpdates() {
- selenium.click(pjq("input[type=radio][name$=bypassUpdatesInput][value=true]"));
+ @IssueTracking("https://issues.jboss.org/browse/RF-10312")
+ public void testExpanded() {
+ verifyBeforeClick();
+
+ selenium.click(pjq("input[type=radio][name$=expandedInput][value=false]"));
selenium.waitForPageToLoad();
- String timeValue = selenium.getText(time);
- guardXhr(selenium).click(header);
- waitGui.failWith("Page was not updated").waitForChange(timeValue, retrieveText.locator(time));
-
- assertPhases(PhaseId.RESTORE_VIEW, PhaseId.APPLY_REQUEST_VALUES, PhaseId.PROCESS_VALIDATIONS,
- PhaseId.RENDER_RESPONSE);
+ verifyAfterClick();
}
@Test
@@ -137,28 +151,71 @@
selenium.type(pjq("input[type=text][id$=headerInput]"), "new header");
selenium.waitForPageToLoad();
- assertEquals(selenium.getText(header), "new header", "Header of the panel did not change.");
+ assertEquals(selenium.getText(headerExp), "new header", "Header of the panel did not change.");
selenium.type(pjq("input[type=text][id$=headerInput]"), "ľščťťžžôúňď ацущьмщфзщйцу");
selenium.waitForPageToLoad();
- assertEquals(selenium.getText(header), "ľščťťžžôúňď ацущьмщфзщйцу", "Header of the panel did not change.");
+ assertEquals(selenium.getText(headerExp), "ľščťťžžôúňď ацущьмщфзщйцу", "Header of the panel did not change.");
}
@Test
+ public void testHeaderClass() {
+ testStyleClass(header, "headerClass");
+ }
+
+ @Test
+ @IssueTracking("https://issues.jboss.org/browse/RF-10331")
+ public void testHeaderControlClass() {
+ testStyleClass(header.getDescendant(jq("td.rf-cp-ico")), "headerControlClass");
+ }
+
+ @Test
@IssueTracking("https://issues.jboss.org/browse/RF-10054")
public void testImmediate() {
selenium.click(pjq("input[type=radio][name$=immediateInput][value=true]"));
selenium.waitForPageToLoad();
- String timeValue = selenium.getText(time);
+ String reqTime = selenium.getText(time);
guardXhr(selenium).click(header);
- waitGui.failWith("Page was not updated").waitForChange(timeValue, retrieveText.locator(time));
+ waitGui.failWith("Page was not updated").waitForChange(reqTime, retrieveText.locator(time));
- assertPhases(PhaseId.RESTORE_VIEW, PhaseId.APPLY_REQUEST_VALUES, PhaseId.RENDER_RESPONSE);
+ phaseInfo.assertPhases(PhaseId.RESTORE_VIEW, PhaseId.APPLY_REQUEST_VALUES, PhaseId.RENDER_RESPONSE);
+ phaseInfo.assertListener(PhaseId.APPLY_REQUEST_VALUES, "panel collapsed");
}
@Test
+ public void testLang() {
+ testLang(panel);
+ }
+
+ @Test
+ public void testLeftIconCollapsed() {
+ JQueryLocator icon = leftIcon.getDescendant(jq("div.rf-cp-ico-colps"));
+ JQueryLocator input = pjq("select[id$=leftIconCollapsedInput]");
+ JQueryLocator image = leftIcon.getChild(jq("img:nth-child(1)"));
+
+ // icon=null
+ assertTrue(selenium.belongsClass(icon, "rf-ico-chevron-up-hdr"), "Div should have set class rf-ico-chevron-up-hdr.");
+ assertTrue(selenium.getStyle(icon, CssProperty.BACKGROUND_IMAGE).contains("ChevronUp.png"), "Icon should contain a chevron up.");
+
+ verifyStandardIcons(input, icon, image);
+ }
+
+ @Test
+ public void testLeftIconExpanded() {
+ JQueryLocator icon = leftIcon.getDescendant(jq("div.rf-cp-ico-exp"));
+ JQueryLocator input = pjq("select[id$=leftIconExpandedInput]");
+ JQueryLocator image = leftIcon.getChild(jq("img:nth-child(2)"));
+
+ // icon=null
+ assertTrue(selenium.belongsClass(icon, "rf-ico-chevron-down-hdr"), "Div should have set class rf-ico-chevron-down-hdr.");
+ assertTrue(selenium.getStyle(icon, CssProperty.BACKGROUND_IMAGE).contains("ChevronDown.png"), "Icon should contain a chevron down.");
+
+ verifyStandardIcons(input, icon, image);
+ }
+
+ @Test
@IssueTracking("https://issues.jboss.org/browse/RF-9535")
public void testLimitRender() {
selenium.type(pjq("input[type=text][id$=renderInput]"), "@this");
@@ -167,16 +224,103 @@
selenium.click(pjq("input[type=radio][name$=limitRenderInput][value=true]"));
selenium.waitForPageToLoad();
- String timeValue = selenium.getText(time);
+ String reqTime = selenium.getText(time);
guardXhr(selenium).click(header);
waitGui.failWith("Panel should be collapsed.").until(isDisplayed.locator(headerColps));
String newTime = selenium.getText(time);
- assertTrue(newTime.equals(timeValue), "Panel with ajaxRendered=true should not be rerendered (old and new time should be same).");
+ assertTrue(newTime.equals(reqTime), "Panel with ajaxRendered=true should not be rerendered (old and new time should be same).");
}
@Test
+ public void testAjaxEvents() {
+ selenium.type(pjq("input[type=text][id$=onbeginInput]"), "metamerEvents += \"begin \"");
+ selenium.waitForPageToLoad();
+ selenium.type(pjq("input[type=text][id$=onbeforedomupdateInput]"), "metamerEvents += \"beforedomupdate \"");
+ selenium.waitForPageToLoad();
+ selenium.type(pjq("input[type=text][id$=oncompleteInput]"), "metamerEvents += \"complete \"");
+ selenium.waitForPageToLoad();
+
+ selenium.getEval(new JavaScript("window.metamerEvents = \"\";"));
+
+ String reqTime = selenium.getText(time);
+ guardXhr(selenium).click(header);
+ waitGui.failWith("Page was not updated").waitForChange(reqTime, retrieveText.locator(time));
+
+ String[] events = selenium.getEval(new JavaScript("window.metamerEvents")).split(" ");
+
+ assertEquals(events.length, 3, "3 events should be fired.");
+ assertEquals(events[0], "begin", "Attribute onbegin doesn't work");
+ assertEquals(events[1], "beforedomupdate", "Attribute onbeforedomupdate doesn't work");
+ assertEquals(events[2], "complete", "Attribute oncomplete doesn't work");
+ }
+
+ @Test
+ public void testOnbeforeswitchOnswitch() {
+ selenium.type(pjq("input[type=text][id$=onbeforeswitchInput]"), "metamerEvents += \"beforeswitch \"");
+ selenium.waitForPageToLoad();
+ selenium.type(pjq("input[type=text][id$=onswitchInput]"), "metamerEvents += \"switch \"");
+ selenium.waitForPageToLoad();
+
+ selenium.getEval(new JavaScript("window.metamerEvents = \"\";"));
+
+ String reqTime = selenium.getText(time);
+ guardXhr(selenium).click(header);
+
+ String[] events = selenium.getEval(new JavaScript("window.metamerEvents")).split(" ");
+
+ assertEquals(events.length, 2, "2 events should be fired.");
+ assertEquals(events[0], "beforeswitch", "Attribute onbeforeswitch doesn't work");
+ assertEquals(events[1], "switch", "Attribute onswitch doesn't work");
+ }
+
+ @Test
+ public void testOnclick() {
+ testFireEvent(Event.CLICK, panel);
+ }
+
+ @Test
+ public void testOndblclick() {
+ testFireEvent(Event.DBLCLICK, panel);
+ }
+
+ @Test
+ public void testOnmousedown() {
+ testFireEvent(Event.MOUSEDOWN, panel);
+ }
+
+ @Test
+ public void testOnmousemove() {
+ testFireEvent(Event.MOUSEMOVE, panel);
+ }
+
+ @Test
+ public void testOnmouseout() {
+ testFireEvent(Event.MOUSEOUT, panel);
+ }
+
+ @Test
+ public void testOnmouseover() {
+ testFireEvent(Event.MOUSEOVER, panel);
+ }
+
+ @Test
+ public void testOnmouseup() {
+ testFireEvent(Event.MOUSEUP, panel);
+ }
+
+ @Test
+ public void testRender() {
+ selenium.type(pjq("input[type=text][id$=renderInput]"), "renderChecker");
+ selenium.waitForPageToLoad();
+
+ String renderCheckerTime = selenium.getText(renderChecker);
+ guardXhr(selenium).click(header);
+ waitGui.failWith("Attribute render doesn't work").waitForChange(renderCheckerTime, retrieveText.locator(renderChecker));
+ }
+
+ @Test
public void testRendered() {
selenium.click(pjq("input[type=radio][name$=renderedInput][value=false]"));
selenium.waitForPageToLoad();
@@ -184,6 +328,121 @@
assertFalse(selenium.isElementPresent(panel), "Panel should not be rendered when rendered=false.");
}
+ @Test
+ public void testRightIconCollapsed() {
+ JQueryLocator icon = rightIcon.getDescendant(jq("div.rf-cp-ico-colps"));
+ JQueryLocator input = pjq("select[id$=rightIconCollapsedInput]");
+ JQueryLocator image = rightIcon.getChild(jq("img:nth-child(1)"));
+
+ // icon=null
+ assertFalse(selenium.isElementPresent(rightIcon), "Right icon should not be present on the page.");
+
+ verifyStandardIcons(input, icon, image);
+ }
+
+ @Test
+ public void testRightIconExpanded() {
+ JQueryLocator icon = rightIcon.getDescendant(jq("div.rf-cp-ico-exp"));
+ JQueryLocator input = pjq("select[id$=rightIconExpandedInput]");
+ JQueryLocator image = rightIcon.getChild(jq("img:nth-child(1)"));
+
+ // icon=null
+ assertFalse(selenium.isElementPresent(rightIcon), "Right icon should not be present on the page.");
+
+ verifyStandardIcons(input, icon, image);
+ }
+
+ @Test
+ public void testStatus() {
+ selenium.type(pjq("input[type=text][id$=statusInput]"), "statusChecker");
+ selenium.waitForPageToLoad();
+
+ String statusCheckerTime = selenium.getText(statusChecker);
+ guardXhr(selenium).click(header);
+ waitGui.failWith("Attribute status doesn't work").waitForChange(statusCheckerTime, retrieveText.locator(statusChecker));
+ }
+
+ @Test
+ public void testStyle() {
+ testStyle(panel, "style");
+ }
+
+ @Test
+ public void testStyleClass() {
+ testStyleClass(panel, "styleClass");
+ }
+
+ @Test
+ public void testSwitchTypeNull() {
+ // click to collapse
+ String reqTime = selenium.getText(time);
+ guardXhr(selenium).click(header);
+ waitGui.failWith("Page was not updated").waitForChange(reqTime, retrieveText.locator(time));
+
+ verifyAfterClick();
+
+ // click to expand
+ reqTime = selenium.getText(time);
+ guardXhr(selenium).click(header);
+ waitGui.failWith("Page was not updated").waitForChange(reqTime, retrieveText.locator(time));
+
+ verifyBeforeClick();
+ }
+
+ @Test
+ public void testSwitchTypeAjax() {
+ selenium.click(pjq("input[name$=switchTypeInput][value=ajax]"));
+ selenium.waitForPageToLoad();
+
+ testSwitchTypeNull();
+ }
+
+ @Test
+ public void testSwitchTypeClient() {
+ selenium.click(pjq("input[name$=switchTypeInput][value=client]"));
+ selenium.waitForPageToLoad();
+
+ // click to collapse
+ guardNoRequest(selenium).click(header);
+ verifyAfterClick();
+
+ // click to expand
+ guardNoRequest(selenium).click(header);
+ verifyBeforeClick();
+ }
+
+ @Test
+ public void testSwitchTypeServer() {
+ selenium.click(pjq("input[name$=switchTypeInput][value=server]"));
+ selenium.waitForPageToLoad();
+
+ // click to collapse
+ guardHttp(selenium).click(header);
+ verifyAfterClick();
+
+ // click to expand
+ guardHttp(selenium).click(header);
+ verifyBeforeClick();
+ }
+
+ @Test
+ public void testTitle() {
+ testTitle(panel);
+ }
+
+ @Test
+ public void testToggleListener() {
+ String reqTime = selenium.getText(time);
+ guardXhr(selenium).click(header);
+ waitGui.failWith("Page was not updated").waitForChange(reqTime, retrieveText.locator(time));
+ phaseInfo.assertListener(PhaseId.INVOKE_APPLICATION, "panel collapsed");
+
+ reqTime = selenium.getText(time);
+ guardXhr(selenium).click(header);
+ waitGui.failWith("Page was not updated").waitForChange(reqTime, retrieveText.locator(time));
+ phaseInfo.assertListener(PhaseId.INVOKE_APPLICATION, "panel expanded");
+ }
+
private void verifyBeforeClick() {
boolean displayed = selenium.isDisplayed(panel);
assertTrue(displayed, "Collapsible panel is not present on the page.");
@@ -197,7 +456,7 @@
displayed = selenium.isDisplayed(content);
assertTrue(displayed, "Panel's content should be visible.");
- String text = selenium.getText(header);
+ String text = selenium.getText(headerExp);
assertEquals(text, "collapsible panel header", "Header of the panel.");
text = selenium.getText(content);
@@ -219,7 +478,61 @@
assertFalse(displayed, "Panel's content should not be visible.");
}
- String text = selenium.getText(header);
+ String text = selenium.getText(headerColps);
assertEquals(text, "collapsible panel header", "Header of the panel.");
}
+
+ private void verifyStandardIcons(JQueryLocator input, JQueryLocator icon, JQueryLocator image) {
+ selenium.select(input, optionLabel("chevronDown"));
+ selenium.waitForPageToLoad();
+ assertTrue(selenium.belongsClass(icon, "rf-ico-chevron-down-hdr"), "Div should have set class rf-ico-chevron-down-hdr.");
+ assertTrue(selenium.getStyle(icon, CssProperty.BACKGROUND_IMAGE).contains("ChevronDown.png"), "Icon should contain a chevron down.");
+
+ selenium.select(input, optionLabel("chevronUp"));
+ selenium.waitForPageToLoad();
+ assertTrue(selenium.belongsClass(icon, "rf-ico-chevron-up-hdr"), "Div should have set class rf-ico-chevron-up-hdr.");
+ assertTrue(selenium.getStyle(icon, CssProperty.BACKGROUND_IMAGE).contains("ChevronUp.png"), "Icon should contain a chevron up.");
+
+ selenium.select(input, optionLabel("disc"));
+ selenium.waitForPageToLoad();
+ assertTrue(selenium.belongsClass(icon, "rf-ico-disc-hdr"), "Div should have set class rf-ico-disc-hdr.");
+ assertTrue(selenium.getStyle(icon, CssProperty.BACKGROUND_IMAGE).contains("Disc.png"), "Icon should contain a disc.");
+
+ selenium.select(input, optionLabel("grid"));
+ selenium.waitForPageToLoad();
+ assertTrue(selenium.belongsClass(icon, "rf-ico-grid-hdr"), "Div should have set class rf-ico-grid-hdr.");
+ assertTrue(selenium.getStyle(icon, CssProperty.BACKGROUND_IMAGE).contains("Grid.png"), "Icon should contain a grid.");
+
+ selenium.select(input, optionLabel("triangle"));
+ selenium.waitForPageToLoad();
+ assertTrue(selenium.belongsClass(icon, "rf-ico-triangle-hdr"), "Div should have set class rf-ico-triangle-hdr.");
+ assertTrue(selenium.getStyle(icon, CssProperty.BACKGROUND_IMAGE).contains("Triangle.png"), "Icon should contain a triangle.");
+
+ selenium.select(input, optionLabel("triangleDown"));
+ selenium.waitForPageToLoad();
+ assertTrue(selenium.belongsClass(icon, "rf-ico-triangle-down-hdr"), "Div should have set class rf-ico-triangle-down-hdr.");
+ assertTrue(selenium.getStyle(icon, CssProperty.BACKGROUND_IMAGE).contains("TriangleDown.png"), "Icon should contain a triangle down.");
+
+ selenium.select(input, optionLabel("triangleUp"));
+ selenium.waitForPageToLoad();
+ assertTrue(selenium.belongsClass(icon, "rf-ico-triangle-up-hdr"), "Div should have set class rf-ico-triangle-up-hdr.");
+ assertTrue(selenium.getStyle(icon, CssProperty.BACKGROUND_IMAGE).contains("TriangleUp.png"), "Icon should contain a triangle up.");
+
+ selenium.select(input, optionLabel("none"));
+ selenium.waitForPageToLoad();
+ assertFalse(selenium.isElementPresent(icon), "Icon should not be present when icon=none.");
+
+ selenium.select(input, optionLabel("star"));
+ selenium.waitForPageToLoad();
+ assertFalse(selenium.isElementPresent(icon), "Icon's div should not be present when icon=star.");
+ waitFor(5000);
+ assertTrue(selenium.isElementPresent(image), "Icon's image should be rendered.");
+ assertTrue(selenium.getAttribute(image.getAttribute(Attribute.SRC)).contains("star.png"), "Icon's src attribute should contain star.png.");
+
+ selenium.select(input, optionLabel("nonexisting"));
+ selenium.waitForPageToLoad();
+ assertFalse(selenium.isElementPresent(icon), "Icon's div should not be present when icon=nonexisting.");
+ assertTrue(selenium.isElementPresent(image), "Icon's image should be rendered.");
+ assertTrue(selenium.getAttribute(image.getAttribute(Attribute.SRC)).contains("nonexisting"), "Icon's src attribute should contain nonexisting.");
+ }
}
13 years, 11 months