JBoss Rich Faces SVN: r21155 - in modules/tests/metamer/trunk: application/src/main/webapp/components/richTree and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: lfryc(a)redhat.com
Date: 2011-01-21 11:03:53 -0500 (Fri, 21 Jan 2011)
New Revision: 21155
Modified:
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTreeBean.java
modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTreeNodeBean.java
modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/simple.xhtml
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TestTreeSimple.java
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TreeNodeAttributes.java
Log:
rich:tree - fix wrong @expanded usage + fix tests (RF-10264)
Modified: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTreeBean.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTreeBean.java 2011-01-21 15:48:44 UTC (rev 21154)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTreeBean.java 2011-01-21 16:03:53 UTC (rev 21155)
@@ -27,6 +27,8 @@
import java.util.HashMap;
import java.util.List;
import java.util.Map;
+import java.util.Map.Entry;
+import java.util.TreeMap;
import javax.annotation.PostConstruct;
import javax.faces.bean.ManagedBean;
@@ -66,6 +68,8 @@
private boolean testLoadingFacet = false;
private boolean delayedRender = false;
+
+ private Map<TreeNode, Boolean> expanded = new HashMap<TreeNode, Boolean>();
/**
* Initializes the managed bean.
@@ -87,6 +91,7 @@
attributes.remove("var");
attributes.remove("rowKeyVar");
attributes.remove("stateVar");
+ attributes.remove("nodeType");
for (CompactDiscXmlDescriptor descriptor : model.getCompactDiscs()) {
createCompactDisc(descriptor);
@@ -107,6 +112,7 @@
CompactDisc cd = new CompactDisc(descriptor.getTitle(), descriptor.getArtist(), company, descriptor.getPrice(),
descriptor.getYear());
company.getCds().add(cd);
+ expanded.put(cd, false);
return cd;
}
@@ -121,6 +127,7 @@
company.setParent(country);
country.getCompanies().add(company);
companiesCache.put(companyName, company);
+ expanded.put(company, false);
}
return company;
}
@@ -132,6 +139,7 @@
country = new Country();
country.setName(countryName);
countriesCache.put(countryName, country);
+ expanded.put(country, false);
root.add(country);
}
return country;
@@ -179,4 +187,20 @@
}
}
}
+
+ public Map<TreeNode, Boolean> getExpanded() {
+ return expanded;
+ }
+
+ public void expandAll() {
+ for (Entry<TreeNode, Boolean> entry : expanded.entrySet()) {
+ entry.setValue(true);
+ }
+ }
+
+ public void collapseAll() {
+ for (Entry<TreeNode, Boolean> entry : expanded.entrySet()) {
+ entry.setValue(false);
+ }
+ }
}
Modified: modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTreeNodeBean.java
===================================================================
--- modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTreeNodeBean.java 2011-01-21 15:48:44 UTC (rev 21154)
+++ modules/tests/metamer/trunk/application/src/main/java/org/richfaces/tests/metamer/bean/RichTreeNodeBean.java 2011-01-21 16:03:53 UTC (rev 21155)
@@ -58,6 +58,7 @@
// attributes which needs to be tested another way
attributes[i].remove("type");
+ attributes[i].remove("expanded");
}
}
Modified: modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/simple.xhtml
===================================================================
--- modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/simple.xhtml 2011-01-21 15:48:44 UTC (rev 21154)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richTree/simple.xhtml 2011-01-21 16:03:53 UTC (rev 21155)
@@ -97,8 +97,8 @@
>
<rich:treeNode type="country"
+ expanded="#{richTreeBean.expanded[node]}"
rendered="#{richTreeNodeBean.attributes[0]['rendered'].value}"
- expanded="#{richTreeNodeBean.attributes[0]['expanded'].value}"
iconLeaf="#{richTreeNodeBean.attributes[0]['iconLeaf'].value}"
iconExpanded="#{richTreeNodeBean.attributes[0]['iconExpanded'].value}"
iconCollapsed="#{richTreeNodeBean.attributes[0]['iconCollapsed'].value}"
@@ -115,8 +115,8 @@
<rich:treeNode type="company"
icon="/images/tree/disc.gif"
+ expanded="#{richTreeBean.expanded[node]}"
rendered="#{richTreeNodeBean.attributes[1]['rendered'].value}"
- expanded="#{richTreeNodeBean.attributes[1]['expanded'].value}"
iconLeaf="#{richTreeNodeBean.attributes[1]['iconLeaf'].value}"
iconExpanded="#{richTreeNodeBean.attributes[1]['iconExpanded'].value}"
iconCollapsed="#{richTreeNodeBean.attributes[1]['iconCollapsed'].value}"
@@ -134,8 +134,8 @@
<rich:treeNode type="cd"
icon="/images/tree/song.gif"
+ expanded="#{richTreeBean.expanded[node]}"
rendered="#{richTreeNodeBean.attributes[2]['rendered'].value}"
- expanded="#{richTreeNodeBean.attributes[2]['expanded'].value}"
iconLeaf="#{richTreeNodeBean.attributes[2]['iconLeaf'].value}"
iconExpanded="#{richTreeNodeBean.attributes[2]['iconExpanded'].value}"
iconCollapsed="#{richTreeNodeBean.attributes[2]['iconCollapsed'].value}"
@@ -204,9 +204,12 @@
<ui:define name="outOfTemplateAfter">
-
+ <a4j:commandButton id="expandAll" value="Expand All" action="#{richTreeBean.expandAll}" render="#{nestedComponentId}" />
+ <a4j:commandButton id="collapseAll" value="Collapse All" action="#{richTreeBean.collapseAll}" render="#{nestedComponentId}" />
+
<a4j:outputPanel ajaxRendered="true">
<h:panelGrid columns="2">
+
<h:outputLabel value="Test Loading Facet:" />
<h:selectBooleanCheckbox value="#{richTreeBean.testLoadingFacet}">
<a4j:ajax render="#{nestedComponentId}" />
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TestTreeSimple.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TestTreeSimple.java 2011-01-21 15:48:44 UTC (rev 21154)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TestTreeSimple.java 2011-01-21 16:03:53 UTC (rev 21155)
@@ -34,6 +34,8 @@
import static org.jboss.test.selenium.dom.Event.MOUSEOVER;
import static org.jboss.test.selenium.dom.Event.MOUSEUP;
import static org.jboss.test.selenium.guard.request.RequestTypeGuardFactory.guard;
+import static org.jboss.test.selenium.guard.request.RequestTypeGuardFactory.guardXhr;
+import static org.jboss.test.selenium.locator.LocatorFactory.jq;
import static org.jboss.test.selenium.utils.URLUtils.buildUrl;
import static org.jboss.test.selenium.utils.text.SimplifiedFormat.format;
import static org.testng.Assert.assertEquals;
@@ -72,11 +74,6 @@
Event domEvent;
Event[] domEvents = { CLICK, DBLCLICK, KEYDOWN, KEYPRESS, KEYUP, MOUSEDOWN, MOUSEMOVE, MOUSEOUT, MOUSEOVER, MOUSEUP };
- @Override
- public URL getTestUrl() {
- return buildUrl(contextPath, "faces/components/richTree/simple.xhtml");
- }
-
TreeModel tree = new TreeModel(pjq("div.rf-tr[id$=richTree]"));
TreeNodeModel treeNode;
@@ -86,6 +83,13 @@
new TreeNodeAttributes(pjq("span[id*=treeNode2Attributes]")),
new TreeNodeAttributes(pjq("span[id*=treeNode3Attributes]")) };
+ JQueryLocator expandAll = jq("input:submit[id$=expandAll]");
+
+ @Override
+ public URL getTestUrl() {
+ return buildUrl(contextPath, "faces/components/richTree/simple.xhtml");
+ }
+
@Test
public void testData() {
attributes.setData("RichFaces 4");
@@ -149,7 +153,7 @@
assertEquals(with > 0, i < 2);
assertEquals(without > 0, i > 0);
- nodeAttributes[i].setExpanded(true);
+ expandLevel(i);
}
}
@@ -168,7 +172,7 @@
assertEquals(with > 0, i > 0);
assertEquals(without > 0, i < 2);
- nodeAttributes[i].setExpanded(true);
+ expandLevel(i);
}
}
@@ -187,7 +191,7 @@
assertEquals(with > 0, i > 1);
assertEquals(without > 0, i < 2);
- nodeAttributes[i].setExpanded(true);
+ expandLevel(i);
}
}
@@ -313,7 +317,23 @@
}
private void expandAll() {
- nodeAttributes[0].setExpanded(true);
- nodeAttributes[1].setExpanded(true);
+ guardXhr(selenium).click(expandAll);
}
+
+ private void expandLevel(int level) {
+ switch (level) {
+ case 0:
+ for (TreeNodeModel treeNode1 : tree.getNodes()) {
+ treeNode1.expand();
+ }
+ break;
+ case 1:
+ for (TreeNodeModel treeNode1 : tree.getNodes()) {
+ for (TreeNodeModel treeNode2 : treeNode1.getNodes()) {
+ treeNode2.expand();
+ }
+ }
+ default:
+ }
+ }
}
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TreeNodeAttributes.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TreeNodeAttributes.java 2011-01-21 15:48:44 UTC (rev 21154)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richTree/TreeNodeAttributes.java 2011-01-21 16:03:53 UTC (rev 21155)
@@ -42,10 +42,6 @@
setProperty("dir", dir);
}
- public void setExpanded(Boolean expanded) {
- setProperty("expanded", expanded);
- }
-
public void setIconCollapsed(String iconCollapsed) {
setProperty("iconCollapsed", iconCollapsed);
}
13 years, 11 months
JBoss Rich Faces SVN: r21154 - modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richToolbarGroup.
by richfaces-svn-commits@lists.jboss.org
Author: ppitonak(a)redhat.com
Date: 2011-01-21 10:48:44 -0500 (Fri, 21 Jan 2011)
New Revision: 21154
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richToolbarGroup/TestRichToolbarGroup.java
Log:
* testLocation fixed
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richToolbarGroup/TestRichToolbarGroup.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richToolbarGroup/TestRichToolbarGroup.java 2011-01-21 15:28:15 UTC (rev 21153)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richToolbarGroup/TestRichToolbarGroup.java 2011-01-21 15:48:44 UTC (rev 21154)
@@ -163,8 +163,8 @@
@Test
public void testLocation() {
- JQueryLocator emptyCellBefore = toolbar.getDescendant(jq("td:not([class]):nth-child(1)"));
- JQueryLocator emptyCellAfter = toolbar.getDescendant(jq("td:not([class]):nth-child(7)"));
+ JQueryLocator emptyCellBefore = toolbar.getDescendant(jq("td.rf-tb-emp:nth-child(1)"));
+ JQueryLocator emptyCellAfter = toolbar.getDescendant(jq("td.rf-tb-emp:nth-child(7)"));
assertFalse(selenium.isElementPresent(emptyCellBefore), "Toolbar group should be located on the left.");
assertTrue(selenium.isElementPresent(emptyCellAfter), "Toolbar group should be located on the left.");
13 years, 11 months
JBoss Rich Faces SVN: r21153 - modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jCommandLink.
by richfaces-svn-commits@lists.jboss.org
Author: ppitonak(a)redhat.com
Date: 2011-01-21 10:28:15 -0500 (Fri, 21 Jan 2011)
New Revision: 21153
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jCommandLink/TestA4JCommandLink.java
Log:
* test for attribute target removed because it was removed from RF
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jCommandLink/TestA4JCommandLink.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jCommandLink/TestA4JCommandLink.java 2011-01-21 14:30:04 UTC (rev 21152)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jCommandLink/TestA4JCommandLink.java 2011-01-21 15:28:15 UTC (rev 21153)
@@ -407,12 +407,6 @@
}
@Test
- @IssueTracking("https://issues.jboss.org/browse/RF-10222")
- public void testTarget() {
- testHtmlAttribute(link, "target", "_blank");
- }
-
- @Test
public void testTitle() {
testTitle(link);
}
13 years, 11 months
JBoss Rich Faces SVN: r21152 - trunk/ui/output/ui/src/main/java/org/richfaces/component.
by richfaces-svn-commits@lists.jboss.org
Author: Alex.Kolonitsky
Date: 2011-01-21 09:30:04 -0500 (Fri, 21 Jan 2011)
New Revision: 21152
Modified:
trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractAccordion.java
trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractCollapsiblePanel.java
trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractTabPanel.java
trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractTogglePanel.java
Log:
RF-10261 Taglib: panels are missing attributes
Modified: trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractAccordion.java
===================================================================
--- trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractAccordion.java 2011-01-21 13:58:26 UTC (rev 21151)
+++ trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractAccordion.java 2011-01-21 14:30:04 UTC (rev 21152)
@@ -47,6 +47,7 @@
}
@Override
+ @Attribute
public String getActiveItem() {
String res = super.getActiveItem();
if (res == null) {
Modified: trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractCollapsiblePanel.java
===================================================================
--- trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractCollapsiblePanel.java 2011-01-21 13:58:26 UTC (rev 21151)
+++ trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractCollapsiblePanel.java 2011-01-21 14:30:04 UTC (rev 21152)
@@ -84,7 +84,7 @@
return isExpanded();
}
-
+ @Attribute
public boolean isExpanded() {
return Boolean.parseBoolean(getActiveItem());
}
Modified: trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractTabPanel.java
===================================================================
--- trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractTabPanel.java 2011-01-21 13:58:26 UTC (rev 21151)
+++ trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractTabPanel.java 2011-01-21 14:30:04 UTC (rev 21152)
@@ -49,6 +49,7 @@
}
@Override
+ @Attribute(generate = false)
public String getActiveItem() {
String res = super.getActiveItem();
if (res == null) {
Modified: trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractTogglePanel.java
===================================================================
--- trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractTogglePanel.java 2011-01-21 13:58:26 UTC (rev 21151)
+++ trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractTogglePanel.java 2011-01-21 14:30:04 UTC (rev 21152)
@@ -132,6 +132,7 @@
getStateHelper().put(PropertyKeys.required, required);
}
+ @Attribute
public boolean isImmediate() {
return (Boolean) getStateHelper().eval(PropertyKeys.immediate, false);
}
@@ -574,6 +575,7 @@
setLocalValueSet(true);
}
+ @Attribute
public String getActiveItem() {
return (String) getValue();
}
13 years, 11 months
JBoss Rich Faces SVN: r21151 - in trunk/ui/output/ui/src/main: java/org/richfaces/renderkit/html and 1 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: Alex.Kolonitsky
Date: 2011-01-21 08:58:26 -0500 (Fri, 21 Jan 2011)
New Revision: 21151
Modified:
trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractPopupPanel.java
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/PopupPanelBaseRenderer.java
trunk/ui/output/ui/src/main/templates/popupPanel.template.xml
Log:
RF-10245 Taglib: popup panel missing style and styleClass
Modified: trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractPopupPanel.java
===================================================================
--- trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractPopupPanel.java 2011-01-21 13:57:12 UTC (rev 21150)
+++ trunk/ui/output/ui/src/main/java/org/richfaces/component/AbstractPopupPanel.java 2011-01-21 13:58:26 UTC (rev 21151)
@@ -42,6 +42,12 @@
public static final String COMPONENT_FAMILY = "org.richfaces.PopupPanel";
@Attribute
+ public abstract String getStyle();
+
+ @Attribute
+ public abstract String getStyleClass();
+
+ @Attribute
public abstract String getVisualOptions();
@Attribute(defaultValue = "100")
Modified: trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/PopupPanelBaseRenderer.java
===================================================================
--- trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/PopupPanelBaseRenderer.java 2011-01-21 13:57:12 UTC (rev 21150)
+++ trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/PopupPanelBaseRenderer.java 2011-01-21 13:58:26 UTC (rev 21151)
@@ -169,6 +169,24 @@
}
return "";
}
+
+ public String getContainerStyle(UIComponent panel){
+ StringBuilder res = new StringBuilder();
+ Map<String, Object> attrs = panel.getAttributes();
+ res.append("position: ").append(((Boolean) attrs.get("followByScroll")) ? "fixed" : "absolute").append("; ");
+
+ Integer zindex = (Integer) attrs.get("zindex");
+ if (zindex != null) {
+ res.append("z-index:").append(zindex).append("; ");
+ }
+
+ String style = (String) attrs.get("style");
+ if (style != null && style.length() > 0) {
+ res.append(style);
+ }
+
+ return res.toString();
+ }
private Object buildEventFunction(Object eventFunction) {
if(eventFunction != null && eventFunction.toString().length() > 0) {
return "new Function(\"" + eventFunction.toString() + "\");";
Modified: trunk/ui/output/ui/src/main/templates/popupPanel.template.xml
===================================================================
--- trunk/ui/output/ui/src/main/templates/popupPanel.template.xml 2011-01-21 13:57:12 UTC (rev 21150)
+++ trunk/ui/output/ui/src/main/templates/popupPanel.template.xml 2011-01-21 13:58:26 UTC (rev 21151)
@@ -32,7 +32,7 @@
</c:if>
<div id="#{clientId}_shadow" style="position: #{component.attributes['followByScroll'] ? 'fixed' : 'absolute'};" class="rf-pp-shdw"/>
- <div id="#{clientId}_container" style="position: #{component.attributes['followByScroll'] ? 'fixed' : 'absolute'}; #{not empty zindex ? 'z-index:'+zindex+';':''}" cdk:passThroughWithExclusions="id style class styleClass" class="rf-pp-cntr #{component.attributes['styleClass']}">
+ <div id="#{clientId}_container" style="#{getContainerStyle(component)}" cdk:passThroughWithExclusions="id style class styleClass" class="rf-pp-cntr #{component.attributes['styleClass']}">
<c:if test="#{component.getFacet('header')!=null and component.getFacet('header').rendered}">
<div id="#{clientId}_header" class="rf-pp-hdr #{component.attributes['headerClass']}" >
13 years, 11 months
JBoss Rich Faces SVN: r21150 - trunk/ui/dnd/ui/src/main/resources/META-INF/resources/org.richfaces.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2011-01-21 08:57:12 -0500 (Fri, 21 Jan 2011)
New Revision: 21150
Modified:
trunk/ui/dnd/ui/src/main/resources/META-INF/resources/org.richfaces/dnd-draggable.js
trunk/ui/dnd/ui/src/main/resources/META-INF/resources/org.richfaces/dnd-droppable.js
trunk/ui/dnd/ui/src/main/resources/META-INF/resources/org.richfaces/dnd-indicator.js
Log:
https://issues.jboss.org/browse/RF-10033 drag-n-drop: apply changes after pre-promotion code review
Modified: trunk/ui/dnd/ui/src/main/resources/META-INF/resources/org.richfaces/dnd-draggable.js
===================================================================
--- trunk/ui/dnd/ui/src/main/resources/META-INF/resources/org.richfaces/dnd-draggable.js 2011-01-21 13:46:25 UTC (rev 21149)
+++ trunk/ui/dnd/ui/src/main/resources/META-INF/resources/org.richfaces/dnd-draggable.js 2011-01-21 13:57:12 UTC (rev 21150)
@@ -69,7 +69,7 @@
if(this.__isCustomDragIndicator()) {
var indicator = rf.$(this.options.indicator);
if(indicator) {
- ui.helper.addClass(indicator.draggingClass());
+ ui.helper.addClass(indicator.getDraggingClass());
} else {
ui.helper.addClass(defaultIndicatorClasses.draggingClass);
}
Modified: trunk/ui/dnd/ui/src/main/resources/META-INF/resources/org.richfaces/dnd-droppable.js
===================================================================
--- trunk/ui/dnd/ui/src/main/resources/META-INF/resources/org.richfaces/dnd-droppable.js 2011-01-21 13:46:25 UTC (rev 21149)
+++ trunk/ui/dnd/ui/src/main/resources/META-INF/resources/org.richfaces/dnd-droppable.js 2011-01-21 13:57:12 UTC (rev 21150)
@@ -39,8 +39,8 @@
var dragIndicatorObj = rf.$(ui.helper.attr("id"));
if (dragIndicatorObj) {
- ui.helper.removeClass(dragIndicatorObj.acceptClass());
- ui.helper.removeClass(dragIndicatorObj.rejectClass());
+ ui.helper.removeClass(dragIndicatorObj.getAcceptClass());
+ ui.helper.removeClass(dragIndicatorObj.getRejectClass());
} else {
ui.helper.removeClass(defaultIndicatorClasses.acceptClass);
ui.helper.removeClass(defaultIndicatorClasses.rejectClass);
@@ -52,11 +52,11 @@
var dragIndicatorObj = rf.$(ui.helper.attr("id"));
if (dragIndicatorObj) {
if (this.accept(draggable)) {
- ui.helper.removeClass(dragIndicatorObj.rejectClass());
- ui.helper.addClass(dragIndicatorObj.acceptClass());
+ ui.helper.removeClass(dragIndicatorObj.getRejectClass());
+ ui.helper.addClass(dragIndicatorObj.getAcceptClass());
} else {
- ui.helper.removeClass(dragIndicatorObj.acceptClass());
- ui.helper.addClass(dragIndicatorObj.rejectClass());
+ ui.helper.removeClass(dragIndicatorObj.getAcceptClass());
+ ui.helper.addClass(dragIndicatorObj.getRejectClass());
}
} else {
if (this.accept(draggable)) {
@@ -73,8 +73,8 @@
var draggable = ui.draggable;
var dragIndicatorObj = rf.$(ui.helper.attr("id"));
if (dragIndicatorObj) {
- ui.helper.removeClass(dragIndicatorObj.acceptClass());
- ui.helper.removeClass(dragIndicatorObj.rejectClass());
+ ui.helper.removeClass(dragIndicatorObj.getAcceptClass());
+ ui.helper.removeClass(dragIndicatorObj.getRejectClass());
} else {
ui.helper.removeClass(defaultIndicatorClasses.acceptClass);
Modified: trunk/ui/dnd/ui/src/main/resources/META-INF/resources/org.richfaces/dnd-indicator.js
===================================================================
--- trunk/ui/dnd/ui/src/main/resources/META-INF/resources/org.richfaces/dnd-indicator.js 2011-01-21 13:46:25 UTC (rev 21149)
+++ trunk/ui/dnd/ui/src/main/resources/META-INF/resources/org.richfaces/dnd-indicator.js 2011-01-21 13:57:12 UTC (rev 21150)
@@ -36,15 +36,15 @@
this.indicator.hide();
},
- acceptClass: function() {
+ getAcceptClass: function() {
return this.options.acceptClass;
},
- rejectClass: function() {
+ getRejectClass: function() {
return this.options.rejectClass;
},
- draggingClass: function() {
+ getDraggingClass: function() {
return this.options.draggingClass;
},
13 years, 11 months
JBoss Rich Faces SVN: r21149 - trunk/ui/iteration/ui/src/main/java/org/richfaces/component.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2011-01-21 08:46:25 -0500 (Fri, 21 Jan 2011)
New Revision: 21149
Added:
trunk/ui/iteration/ui/src/main/java/org/richfaces/component/StatefulDataTableChildrenIterator.java
Modified:
trunk/ui/iteration/ui/src/main/java/org/richfaces/component/UIDataTableBase.java
Log:
https://issues.jboss.org/browse/RF-9426
Added: trunk/ui/iteration/ui/src/main/java/org/richfaces/component/StatefulDataTableChildrenIterator.java
===================================================================
--- trunk/ui/iteration/ui/src/main/java/org/richfaces/component/StatefulDataTableChildrenIterator.java (rev 0)
+++ trunk/ui/iteration/ui/src/main/java/org/richfaces/component/StatefulDataTableChildrenIterator.java 2011-01-21 13:46:25 UTC (rev 21149)
@@ -0,0 +1,67 @@
+package org.richfaces.component;
+
+import java.util.Iterator;
+
+import javax.faces.component.UIComponent;
+
+import org.ajax4jsf.component.IterationStateHolder;
+
+import com.google.common.collect.AbstractIterator;
+import com.google.common.collect.Iterators;
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+final class StatefulDataTableChildrenIterator extends AbstractIterator<UIComponent> {
+
+ private Iterator<UIComponent> dataChildren;
+
+ private Iterator<UIComponent> subIterator = Iterators.emptyIterator();
+
+ /**
+ * @param uiDataTableBase
+ */
+ StatefulDataTableChildrenIterator(Iterator<UIComponent> dataChildren) {
+ this.dataChildren = dataChildren;
+ }
+
+ private UIComponent traverseToNextElement() {
+ if (dataChildren.hasNext()) {
+ UIComponent c = dataChildren.next();
+
+ if (c instanceof IterationStateHolder) {
+ return c;
+ } else {
+ subIterator = c.getFacetsAndChildren();
+ }
+ }
+
+ return null;
+ }
+
+ private UIComponent traverseToNextSubElement() {
+ if (subIterator.hasNext()) {
+ return subIterator.next();
+ }
+
+ return null;
+ }
+
+ @Override
+ protected UIComponent computeNext() {
+ while (dataChildren.hasNext() || subIterator.hasNext()) {
+ UIComponent c = traverseToNextSubElement();
+
+ if (c == null) {
+ c = traverseToNextElement();
+ }
+
+ if (c != null) {
+ return c;
+ }
+ }
+
+ return endOfData();
+ }
+}
\ No newline at end of file
Modified: trunk/ui/iteration/ui/src/main/java/org/richfaces/component/UIDataTableBase.java
===================================================================
--- trunk/ui/iteration/ui/src/main/java/org/richfaces/component/UIDataTableBase.java 2011-01-21 13:36:56 UTC (rev 21148)
+++ trunk/ui/iteration/ui/src/main/java/org/richfaces/component/UIDataTableBase.java 2011-01-21 13:46:25 UTC (rev 21149)
@@ -62,6 +62,7 @@
import org.richfaces.model.SortMode;
import org.richfaces.renderkit.MetaComponentRenderer;
+
public abstract class UIDataTableBase extends UISequence implements Row, MetaComponentResolver, MetaComponentEncoder {
public static final String COMPONENT_FAMILY = "org.richfaces.Data";
@@ -369,5 +370,27 @@
public static Set<String> getSupportedMetaComponents() {
return SUPPORTED_META_COMPONENTS;
}
-
+
+ protected Iterator<UIComponent> statefulChildren() {
+ return new StatefulDataTableChildrenIterator(this.dataChildren());
+ }
+
+ @Override
+ protected void saveChildState(FacesContext facesContext) {
+ Iterator<UIComponent> iterator = statefulChildren();
+ while (iterator.hasNext()) {
+ UIComponent c = iterator.next();
+ saveChildState(facesContext, c);
+ }
+ }
+
+ @Override
+ protected void restoreChildState(FacesContext facesContext) {
+ Iterator<UIComponent> iterator = statefulChildren();
+ while (iterator.hasNext()) {
+ UIComponent c = iterator.next();
+ restoreChildState(facesContext, c);
+ }
+ }
+
}
13 years, 11 months
JBoss Rich Faces SVN: r21148 - trunk/ui/output/ui/src/test/java/org/richfaces/renderkit/html.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2011-01-21 08:36:56 -0500 (Fri, 21 Jan 2011)
New Revision: 21148
Modified:
trunk/ui/output/ui/src/test/java/org/richfaces/renderkit/html/DropDownMenuRendererTest.java
trunk/ui/output/ui/src/test/java/org/richfaces/renderkit/html/MenuItemRendererTest.java
Log:
Modified: trunk/ui/output/ui/src/test/java/org/richfaces/renderkit/html/DropDownMenuRendererTest.java
===================================================================
--- trunk/ui/output/ui/src/test/java/org/richfaces/renderkit/html/DropDownMenuRendererTest.java 2011-01-21 13:28:40 UTC (rev 21147)
+++ trunk/ui/output/ui/src/test/java/org/richfaces/renderkit/html/DropDownMenuRendererTest.java 2011-01-21 13:36:56 UTC (rev 21148)
@@ -73,7 +73,6 @@
@Test
public void testAjaxClick() throws IOException, SAXException {
HtmlPage page = environment.getPage("/dropDownMenu_ajaxMode.jsf");
- System.out.print(page.asXml());
HtmlDivision item = (HtmlDivision) page.getElementById("form:saveAll");
assertNotNull(item);
DropDownMenuBean.setCurrent("none");
Modified: trunk/ui/output/ui/src/test/java/org/richfaces/renderkit/html/MenuItemRendererTest.java
===================================================================
--- trunk/ui/output/ui/src/test/java/org/richfaces/renderkit/html/MenuItemRendererTest.java 2011-01-21 13:28:40 UTC (rev 21147)
+++ trunk/ui/output/ui/src/test/java/org/richfaces/renderkit/html/MenuItemRendererTest.java 2011-01-21 13:36:56 UTC (rev 21148)
@@ -77,11 +77,9 @@
HtmlPage page = environment.getPage("/menuItem_ajaxMode.jsf");
System.out.print(page.asXml());
HtmlDivision item = (HtmlDivision) page.getElementById("form:menuItem");
- System.out.print("item.asXml()"+item.asXml());
assertNotNull(item);
DropDownMenuBean.setCurrent("none");
item.click();
- System.out.print(item.asXml());
item = (HtmlDivision) page.getElementById("form:menuItem");
System.out.print(item.asXml());
assertNotNull(item);
13 years, 11 months
JBoss Rich Faces SVN: r21147 - in trunk/ui/output/ui/src: main/resources/META-INF/resources/org.richfaces and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: abelevich
Date: 2011-01-21 08:28:40 -0500 (Fri, 21 Jan 2011)
New Revision: 21147
Modified:
trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/DropDownMenuRendererBase.java
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/dropdownmenu.ecss
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/menu.js
trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/menuitem.js
trunk/ui/output/ui/src/main/templates/dropdownmenu.template.xml
trunk/ui/output/ui/src/main/templates/menuitem.template.xml
trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/menuItem_ajaxMode.xmlunit.xml
Log:
https://issues.jboss.org/browse/RF-10219 dropDownMenu: need to make visual and behavior corrections. appearance and custor.
Modified: trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/DropDownMenuRendererBase.java
===================================================================
--- trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/DropDownMenuRendererBase.java 2011-01-21 13:01:41 UTC (rev 21146)
+++ trunk/ui/output/ui/src/main/java/org/richfaces/renderkit/html/DropDownMenuRendererBase.java 2011-01-21 13:28:40 UTC (rev 21147)
@@ -37,7 +37,8 @@
public static final String RENDERER_TYPE = "org.richfaces.DropDownMenuRenderer";
- public static final int DEFAULT_MIN_POPUP_WIDTH = 250;
+ public static final int DEFAULT_MIN_POPUP_WIDTH = 250;
+ public static final String DEFAULT_SHOWEVENT = "mouseover";
@Override
public void renderChildren(FacesContext facesContext, UIComponent component) throws IOException {
@@ -156,7 +157,7 @@
protected String getShowEvent(UIComponent component) {
String value = ((AbstractDropDownMenu) component).getShowEvent();
if (value == null || "".equals(value)) {
- value = "click";
+ value = DEFAULT_SHOWEVENT;
}
return value;
}
Modified: trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/dropdownmenu.ecss
===================================================================
--- trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/dropdownmenu.ecss 2011-01-21 13:01:41 UTC (rev 21146)
+++ trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/dropdownmenu.ecss 2011-01-21 13:28:40 UTC (rev 21147)
@@ -20,6 +20,7 @@
}
.rf-ddm-lbl-dec {
font-weight:bold;
+ cursor : pointer;
}
.rf-ddm-lst {
border:1px solid; /*#bfbfc0*/ /*panelBorderColor*/
Modified: trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/menu.js
===================================================================
--- trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/menu.js 2011-01-21 13:01:41 UTC (rev 21146)
+++ trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/menu.js 2011-01-21 13:28:40 UTC (rev 21147)
@@ -8,7 +8,7 @@
hideDelay : 300,
verticalOffset : 0,
horisantalOffset : 0,
- showEvent : 'click',
+ showEvent : 'mouseover',
positionOffset : [0, 0],
direction : "AA",
jointPoint : "AA",
Modified: trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/menuitem.js
===================================================================
--- trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/menuitem.js 2011-01-21 13:01:41 UTC (rev 21146)
+++ trunk/ui/output/ui/src/main/resources/META-INF/resources/org.richfaces/menuitem.js 2011-01-21 13:28:40 UTC (rev 21147)
@@ -1,10 +1,15 @@
(function($, rf) {
rf.ui = rf.ui || {};
+
+ var defaultOptions = {
+ mode : "server"
+ }
// constructor definition
rf.ui.MenuItem = function(componentId, options) {
- this.options = options;
+ this.options = {};
+ $.extend(this.options, defaultOptions, options || {});
$super.constructor.call(this, componentId);
this.attachToDom(componentId);
this.element = $(rf.getDomElement(componentId));
Modified: trunk/ui/output/ui/src/main/templates/dropdownmenu.template.xml
===================================================================
--- trunk/ui/output/ui/src/main/templates/dropdownmenu.template.xml 2011-01-21 13:01:41 UTC (rev 21146)
+++ trunk/ui/output/ui/src/main/templates/dropdownmenu.template.xml 2011-01-21 13:28:40 UTC (rev 21147)
@@ -52,9 +52,12 @@
<cdk:scriptObject name="options">
<cdk:scriptOption name="direction" value="#{getDirection(component).getValue()}" defaultValue="org.richfaces.component.Positioning.DEFAULT.getValue()"/>
<cdk:scriptOption name="jointPoint" value="#{getJointPoint(component).getValue()}" defaultValue="org.richfaces.component.Positioning.DEFAULT.getValue()"/>
- <cdk:scriptOption name="showEvent" value="#{getShowEvent(component)}" defaultValue='"click"'/>
+ <cdk:scriptOption name="showEvent" value="#{getShowEvent(component)}" defaultValue='this.DEFAULT_SHOWEVENT'/>
<cdk:scriptOption name="mode" value="#{getMode(component)}" defaultValue="org.richfaces.component.Mode.server"/>
- <cdk:scriptOption attributes="hideDelay showEvent showDelay horizontalOffset verticalOffset" />
+ <cdk:scriptOption name="horizontalOffset" value="#{component.attributes['horizontalOffset']}" defaultValue='0'/>
+ <cdk:scriptOption name="verticalOffset" value="#{component.attributes['verticalOffset']}" defaultValue='0'/>
+ <cdk:scriptOption name="hideDelay" value="#{component.attributes['hideDelay']}" defaultValue='300'/>
+ <cdk:scriptOption name="showDelay" value="#{component.attributes['showDelay']}" defaultValue='50'/>
<cdk:scriptOption attributes="onshow onhide ongroupshow ongrouphide onitemclick" wrapper="eventHandler"/>
</cdk:scriptObject>
Modified: trunk/ui/output/ui/src/main/templates/menuitem.template.xml
===================================================================
--- trunk/ui/output/ui/src/main/templates/menuitem.template.xml 2011-01-21 13:01:41 UTC (rev 21146)
+++ trunk/ui/output/ui/src/main/templates/menuitem.template.xml 2011-01-21 13:28:40 UTC (rev 21147)
@@ -80,7 +80,7 @@
<c:when test="#{not isDisabled}">
<script type="text/javascript">
<cdk:scriptObject name="options">
- <cdk:scriptOption name="mode" value="#{getSubmitMode(component)}" />
+ <cdk:scriptOption name="mode" value="#{getSubmitMode(component)}" defaultValue="org.richfaces.component.Mode.server"/>
<cdk:scriptOption name="submitFunction" value="#{getOnClickFunction(facesContext, component)}" wrapper="eventHandler"/>
</cdk:scriptObject>
Modified: trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/menuItem_ajaxMode.xmlunit.xml
===================================================================
--- trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/menuItem_ajaxMode.xmlunit.xml 2011-01-21 13:01:41 UTC (rev 21146)
+++ trunk/ui/output/ui/src/test/resources/org/richfaces/renderkit/html/menuItem_ajaxMode.xmlunit.xml 2011-01-21 13:28:40 UTC (rev 21147)
@@ -8,7 +8,7 @@
</span>
<script type="text/javascript">
//<![CDATA[
- new RichFaces.ui.MenuItem("form:menuItem",{"submitFunction":function(event){RichFaces.ajax("form:menuItem",event,{"incId":"1"} );return false;}} );
+ new RichFaces.ui.MenuItem("form:menuItem",{"mode":"ajax","submitFunction":function(event){RichFaces.ajax("form:menuItem",event,{"incId":"1"} );return false;}} );
//]]>
</script>
</div>
13 years, 11 months
JBoss Rich Faces SVN: r21146 - trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces.
by richfaces-svn-commits@lists.jboss.org
Author: pyaschenko
Date: 2011-01-21 08:01:41 -0500 (Fri, 21 Jan 2011)
New Revision: 21146
Modified:
trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inputBase.js
Log:
http://jira.jboss.com/jira/browse/RF-10117
Modified: trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inputBase.js
===================================================================
--- trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inputBase.js 2011-01-21 13:01:19 UTC (rev 21145)
+++ trunk/ui/input/ui/src/main/resources/META-INF/resources/org.richfaces/inputBase.js 2011-01-21 13:01:41 UTC (rev 21146)
@@ -12,7 +12,7 @@
this.attachToDom();
var inputEventHandlers = {};
- inputEventHandlers["keydown"+this.namespace] = this.__keydownHandler;
+ inputEventHandlers[($.browser.opera || $.browser.mozilla ? "keypress" : "keydown")+this.namespace] = this.__keydownHandler;
inputEventHandlers["blur"+this.namespace] = this.__blurHandler;
inputEventHandlers["change"+this.namespace] = this.__changeHandler;
inputEventHandlers["focus"+this.namespace] = this.__focusHandler;
13 years, 11 months