JBoss Rich Faces SVN: r19974 - in trunk/examples/richfaces-showcase/src/main: webapp/richfaces and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: ilya_shaikovsky
Date: 2010-11-05 15:05:34 -0400 (Fri, 05 Nov 2010)
New Revision: 19974
Removed:
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/clientValidation/
Modified:
trunk/examples/richfaces-showcase/src/main/resources/org/richfaces/demo/data/common/navigation.xml
Log:
CSV not ready. removing sample. will revert when ready.
Modified: trunk/examples/richfaces-showcase/src/main/resources/org/richfaces/demo/data/common/navigation.xml
===================================================================
--- trunk/examples/richfaces-showcase/src/main/resources/org/richfaces/demo/data/common/navigation.xml 2010-11-05 18:06:29 UTC (rev 19973)
+++ trunk/examples/richfaces-showcase/src/main/resources/org/richfaces/demo/data/common/navigation.xml 2010-11-05 19:05:34 UTC (rev 19974)
@@ -174,6 +174,21 @@
</demo>
</demos>
</group>
+ <!-- group>
+ <name>Validation</name>
+ <demos>
+ <demo>
+ <id>clientValidation</id>
+ <name>Ajax/Client Validation</name>
+ <samples>
+ <sample>
+ <id>ajaxValidation</id>
+ <name>Simple Ajax Validation</name>
+ </sample>
+ </samples>
+ </demo>
+ </demos>
+ </group-->
<group>
<name>Data Iteration</name>
<demos>
13 years, 8 months
JBoss Rich Faces SVN: r19973 - trunk/examples/parent.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2010-11-05 14:06:29 -0400 (Fri, 05 Nov 2010)
New Revision: 19973
Modified:
trunk/examples/parent/pom.xml
Log:
Updated MyFaces snapshot version to the next
Modified: trunk/examples/parent/pom.xml
===================================================================
--- trunk/examples/parent/pom.xml 2010-11-05 18:03:48 UTC (rev 19972)
+++ trunk/examples/parent/pom.xml 2010-11-05 18:06:29 UTC (rev 19973)
@@ -217,12 +217,12 @@
<dependency>
<groupId>org.apache.myfaces.core</groupId>
<artifactId>myfaces-api</artifactId>
- <version>2.0.2-SNAPSHOT</version>
+ <version>2.0.3-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.myfaces.core</groupId>
<artifactId>myfaces-impl</artifactId>
- <version>2.0.2-SNAPSHOT</version>
+ <version>2.0.3-SNAPSHOT</version>
</dependency>
</dependencies>
</profile>
13 years, 8 months
JBoss Rich Faces SVN: r19972 - in trunk/examples: input-demo/src/main/webapp/WEB-INF and 5 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2010-11-05 14:03:48 -0400 (Fri, 05 Nov 2010)
New Revision: 19972
Added:
trunk/examples/core-demo/src/main/webapp/WEB-INF/jboss-scanning.xml
trunk/examples/input-demo/src/main/webapp/WEB-INF/jboss-scanning.xml
trunk/examples/iteration-demo/src/main/webapp/WEB-INF/jboss-scanning.xml
trunk/examples/misc-demo/src/main/webapp/WEB-INF/jboss-scanning.xml
trunk/examples/output-demo/src/main/webapp/WEB-INF/jboss-scanning.xml
trunk/examples/repeater-demo/src/main/webapp/WEB-INF/jboss-scanning.xml
trunk/examples/validator-demo/src/main/webapp/WEB-INF/jboss-scanning.xml
Log:
https://jira.jboss.org/browse/RF-9427
Added: trunk/examples/core-demo/src/main/webapp/WEB-INF/jboss-scanning.xml
===================================================================
--- trunk/examples/core-demo/src/main/webapp/WEB-INF/jboss-scanning.xml (rev 0)
+++ trunk/examples/core-demo/src/main/webapp/WEB-INF/jboss-scanning.xml 2010-11-05 18:03:48 UTC (rev 19972)
@@ -0,0 +1,11 @@
+<scanning xmlns="urn:jboss:scanning:1.0">
+<!--
+ For JBoss AS 6 integration there is a conflict with guava, and
+ google-collections. JBAS-8361
+-->
+ <path name="WEB-INF/classes"></path>
+
+ <path name="WEB-INF/lib/guava-r05.jar">
+ <exclude name="com.google.common.collect" />
+ </path>
+</scanning>
\ No newline at end of file
Added: trunk/examples/input-demo/src/main/webapp/WEB-INF/jboss-scanning.xml
===================================================================
--- trunk/examples/input-demo/src/main/webapp/WEB-INF/jboss-scanning.xml (rev 0)
+++ trunk/examples/input-demo/src/main/webapp/WEB-INF/jboss-scanning.xml 2010-11-05 18:03:48 UTC (rev 19972)
@@ -0,0 +1,11 @@
+<scanning xmlns="urn:jboss:scanning:1.0">
+<!--
+ For JBoss AS 6 integration there is a conflict with guava, and
+ google-collections. JBAS-8361
+-->
+ <path name="WEB-INF/classes"></path>
+
+ <path name="WEB-INF/lib/guava-r05.jar">
+ <exclude name="com.google.common.collect" />
+ </path>
+</scanning>
\ No newline at end of file
Added: trunk/examples/iteration-demo/src/main/webapp/WEB-INF/jboss-scanning.xml
===================================================================
--- trunk/examples/iteration-demo/src/main/webapp/WEB-INF/jboss-scanning.xml (rev 0)
+++ trunk/examples/iteration-demo/src/main/webapp/WEB-INF/jboss-scanning.xml 2010-11-05 18:03:48 UTC (rev 19972)
@@ -0,0 +1,11 @@
+<scanning xmlns="urn:jboss:scanning:1.0">
+<!--
+ For JBoss AS 6 integration there is a conflict with guava, and
+ google-collections. JBAS-8361
+-->
+ <path name="WEB-INF/classes"></path>
+
+ <path name="WEB-INF/lib/guava-r05.jar">
+ <exclude name="com.google.common.collect" />
+ </path>
+</scanning>
\ No newline at end of file
Added: trunk/examples/misc-demo/src/main/webapp/WEB-INF/jboss-scanning.xml
===================================================================
--- trunk/examples/misc-demo/src/main/webapp/WEB-INF/jboss-scanning.xml (rev 0)
+++ trunk/examples/misc-demo/src/main/webapp/WEB-INF/jboss-scanning.xml 2010-11-05 18:03:48 UTC (rev 19972)
@@ -0,0 +1,11 @@
+<scanning xmlns="urn:jboss:scanning:1.0">
+<!--
+ For JBoss AS 6 integration there is a conflict with guava, and
+ google-collections. JBAS-8361
+-->
+ <path name="WEB-INF/classes"></path>
+
+ <path name="WEB-INF/lib/guava-r05.jar">
+ <exclude name="com.google.common.collect" />
+ </path>
+</scanning>
\ No newline at end of file
Added: trunk/examples/output-demo/src/main/webapp/WEB-INF/jboss-scanning.xml
===================================================================
--- trunk/examples/output-demo/src/main/webapp/WEB-INF/jboss-scanning.xml (rev 0)
+++ trunk/examples/output-demo/src/main/webapp/WEB-INF/jboss-scanning.xml 2010-11-05 18:03:48 UTC (rev 19972)
@@ -0,0 +1,11 @@
+<scanning xmlns="urn:jboss:scanning:1.0">
+<!--
+ For JBoss AS 6 integration there is a conflict with guava, and
+ google-collections. JBAS-8361
+-->
+ <path name="WEB-INF/classes"></path>
+
+ <path name="WEB-INF/lib/guava-r05.jar">
+ <exclude name="com.google.common.collect" />
+ </path>
+</scanning>
\ No newline at end of file
Added: trunk/examples/repeater-demo/src/main/webapp/WEB-INF/jboss-scanning.xml
===================================================================
--- trunk/examples/repeater-demo/src/main/webapp/WEB-INF/jboss-scanning.xml (rev 0)
+++ trunk/examples/repeater-demo/src/main/webapp/WEB-INF/jboss-scanning.xml 2010-11-05 18:03:48 UTC (rev 19972)
@@ -0,0 +1,11 @@
+<scanning xmlns="urn:jboss:scanning:1.0">
+<!--
+ For JBoss AS 6 integration there is a conflict with guava, and
+ google-collections. JBAS-8361
+-->
+ <path name="WEB-INF/classes"></path>
+
+ <path name="WEB-INF/lib/guava-r05.jar">
+ <exclude name="com.google.common.collect" />
+ </path>
+</scanning>
\ No newline at end of file
Added: trunk/examples/validator-demo/src/main/webapp/WEB-INF/jboss-scanning.xml
===================================================================
--- trunk/examples/validator-demo/src/main/webapp/WEB-INF/jboss-scanning.xml (rev 0)
+++ trunk/examples/validator-demo/src/main/webapp/WEB-INF/jboss-scanning.xml 2010-11-05 18:03:48 UTC (rev 19972)
@@ -0,0 +1,11 @@
+<scanning xmlns="urn:jboss:scanning:1.0">
+<!--
+ For JBoss AS 6 integration there is a conflict with guava, and
+ google-collections. JBAS-8361
+-->
+ <path name="WEB-INF/classes"></path>
+
+ <path name="WEB-INF/lib/guava-r05.jar">
+ <exclude name="com.google.common.collect" />
+ </path>
+</scanning>
\ No newline at end of file
13 years, 8 months
JBoss Rich Faces SVN: r19971 - trunk/core/impl/src/main/resources/META-INF/resources.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2010-11-05 13:59:47 -0400 (Fri, 05 Nov 2010)
New Revision: 19971
Modified:
trunk/core/impl/src/main/resources/META-INF/resources/jquery.js
Log:
https://jira.jboss.org/browse/RFPL-664
Modified: trunk/core/impl/src/main/resources/META-INF/resources/jquery.js
===================================================================
--- trunk/core/impl/src/main/resources/META-INF/resources/jquery.js 2010-11-05 17:33:40 UTC (rev 19970)
+++ trunk/core/impl/src/main/resources/META-INF/resources/jquery.js 2010-11-05 17:59:47 UTC (rev 19971)
@@ -6177,6 +6177,24 @@
elem.defaultView || elem.parentWindow :
false;
}
+
+
+//added by nick
+var detectedCompatMode;
+
+function getCompatMode() {
+ var compatMode = document.compatMode || detectedCompatMode;
+ if (!compatMode) {
+ //detect compatMode as described in http://code.google.com/p/doctype/wiki/ArticleCompatMode
+ var width = jQuery(document.createElement("div")).attr('style', 'position:absolute;width:0;height:0;width:1').css('width');
+ detectedCompatMode = compatMode = (width == '1px' ? 'BackCompat' : 'CSS1Compat');
+ }
+
+ return compatMode;
+}
+
+//end of added by nick
+
// Create innerHeight, innerWidth, outerHeight and outerWidth methods
jQuery.each([ "Height", "Width" ], function( i, name ) {
@@ -6212,7 +6230,7 @@
return ("scrollTo" in elem && elem.document) ? // does it walk and quack like a window?
// Everyone else use document.documentElement or document.body depending on Quirks vs Standards mode
- elem.document.compatMode === "CSS1Compat" && elem.document.documentElement[ "client" + name ] ||
+ getCompatMode() /* changed by nick */ === "CSS1Compat" && elem.document.documentElement[ "client" + name ] ||
elem.document.body[ "client" + name ] :
// Get document width or height
13 years, 8 months
JBoss Rich Faces SVN: r19970 - trunk/ui/iteration/ui/src/main/resources/META-INF/resources/org.richfaces.
by richfaces-svn-commits@lists.jboss.org
Author: konstantin.mishin
Date: 2010-11-05 13:33:40 -0400 (Fri, 05 Nov 2010)
New Revision: 19970
Modified:
trunk/ui/iteration/ui/src/main/resources/META-INF/resources/org.richfaces/extendedDataTable.js
Log:
RF-9548
Modified: trunk/ui/iteration/ui/src/main/resources/META-INF/resources/org.richfaces/extendedDataTable.js
===================================================================
--- trunk/ui/iteration/ui/src/main/resources/META-INF/resources/org.richfaces/extendedDataTable.js 2010-11-05 16:48:06 UTC (rev 19969)
+++ trunk/ui/iteration/ui/src/main/resources/META-INF/resources/org.richfaces/extendedDataTable.js 2010-11-05 17:33:40 UTC (rev 19970)
@@ -326,11 +326,13 @@
};
var beginReorder = function(event) {
- idOfReorderingColumn = this.className.match(new RegExp(WIDTH_CLASS_NAME_BASE + "([^\\W]*)"))[1];
- jQuery(document).bind("mousemove", reorder);
- header.find(".rf-edt-hdr-c").bind("mouseover", overReorder);
- jQuery(document).one("mouseup", cancelReorder);
- return false;
+ if (!jQuery(event.target).is("a, img, :input")) {
+ idOfReorderingColumn = this.className.match(new RegExp(WIDTH_CLASS_NAME_BASE + "([^\\W]*)"))[1];
+ jQuery(document).bind("mousemove", reorder);
+ header.find(".rf-edt-hdr-c").bind("mouseover", overReorder);
+ jQuery(document).one("mouseup", cancelReorder);
+ return false;
+ }
};
var overReorder = function(event) {
13 years, 8 months
JBoss Rich Faces SVN: r19969 - in trunk/ui/iteration/ui/src/main: java/org/richfaces/renderkit and 2 other directories.
by richfaces-svn-commits@lists.jboss.org
Author: nbelaevski
Date: 2010-11-05 12:48:06 -0400 (Fri, 05 Nov 2010)
New Revision: 19969
Added:
trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/TreeNodeRendererBase.java
Removed:
trunk/ui/iteration/ui/src/main/java/org/richfaces/component/TreeDecoderHelper.java
Modified:
trunk/ui/iteration/ui/src/main/java/org/richfaces/component/AbstractTree.java
trunk/ui/iteration/ui/src/main/java/org/richfaces/component/AbstractTreeNode.java
trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/TreeEncoderBase.java
trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/TreeEncoderPartial.java
trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/TreeRendererBase.java
trunk/ui/iteration/ui/src/main/resources/META-INF/resources/org.richfaces/tree.js
trunk/ui/iteration/ui/src/main/templates/tree.template.xml
trunk/ui/iteration/ui/src/main/templates/treeNode.template.xml
Log:
https://jira.jboss.org/browse/RF-9627
Modified: trunk/ui/iteration/ui/src/main/java/org/richfaces/component/AbstractTree.java
===================================================================
--- trunk/ui/iteration/ui/src/main/java/org/richfaces/component/AbstractTree.java 2010-11-05 16:32:09 UTC (rev 19968)
+++ trunk/ui/iteration/ui/src/main/java/org/richfaces/component/AbstractTree.java 2010-11-05 16:48:06 UTC (rev 19969)
@@ -25,44 +25,30 @@
import java.util.Collection;
import java.util.HashSet;
import java.util.Iterator;
-import java.util.Map;
-import javax.el.ELContext;
-import javax.el.ELException;
import javax.el.ValueExpression;
-import javax.faces.application.FacesMessage;
import javax.faces.component.UIComponent;
-import javax.faces.component.UpdateModelException;
import javax.faces.component.visit.VisitCallback;
import javax.faces.component.visit.VisitContext;
import javax.faces.component.visit.VisitResult;
import javax.faces.context.FacesContext;
import javax.faces.convert.Converter;
import javax.faces.event.AbortProcessingException;
-import javax.faces.event.ExceptionQueuedEvent;
-import javax.faces.event.ExceptionQueuedEventContext;
import javax.faces.event.FacesEvent;
-import javax.faces.event.PhaseId;
import javax.swing.tree.TreeNode;
import org.ajax4jsf.model.DataComponentState;
import org.ajax4jsf.model.ExtendedDataModel;
import org.ajax4jsf.model.Range;
-import org.richfaces.application.MessageFactory;
-import org.richfaces.application.ServiceTracker;
-import org.richfaces.appplication.FacesMessages;
import org.richfaces.cdk.annotations.Attribute;
import org.richfaces.cdk.annotations.JsfComponent;
import org.richfaces.cdk.annotations.JsfRenderer;
import org.richfaces.cdk.annotations.Tag;
-import org.richfaces.component.util.MessageUtil;
import org.richfaces.context.ExtendedVisitContext;
import org.richfaces.context.ExtendedVisitContextMode;
import org.richfaces.convert.SequenceRowKeyConverter;
import org.richfaces.event.TreeSelectionEvent;
import org.richfaces.event.TreeSelectionListener;
-import org.richfaces.event.TreeToggleEvent;
-import org.richfaces.event.TreeToggleListener;
import org.richfaces.model.ExtendedTreeDataModelImpl;
import org.richfaces.model.SwingTreeNodeDataModelImpl;
import org.richfaces.model.TreeDataModel;
@@ -88,8 +74,6 @@
public static final String COMPONENT_FAMILY = "org.richfaces.Tree";
- public static final String NODE_META_COMPONENT_ID = "node";
-
public static final String SELECTION_META_COMPONENT_ID = "selection";
private static final class MatchingTreeNodePredicate implements Predicate<UIComponent> {
@@ -132,12 +116,11 @@
}
private enum PropertyKeys {
- expanded, selection
+ selection
}
- private transient TreeDecoderHelper treeDecoderHelper = new TreeDecoderHelper(this);
-
public AbstractTree() {
+ setKeepSaved(true);
setRendererType("org.richfaces.TreeRenderer");
}
@@ -182,40 +165,6 @@
getStateHelper().put(PropertyKeys.selection, selection);
}
- @SuppressWarnings("unchecked")
- protected Boolean getLocalExpandedValue(FacesContext facesContext) {
- Map<String, Object> stateMap = (Map<String, Object>) getStateHelper().get(PropertyKeys.expanded);
- if (stateMap == null) {
- return null;
- }
-
- String key = this.getClientId(facesContext);
- return (Boolean) stateMap.get(key);
- }
-
- public boolean isExpanded() {
- if (getRowKey() == null) {
- return true;
- }
-
- FacesContext context = getFacesContext();
- Boolean localExpandedValue = getLocalExpandedValue(context);
- if (localExpandedValue != null) {
- return localExpandedValue.booleanValue();
- }
-
- ValueExpression ve = getValueExpression(PropertyKeys.expanded.toString());
- if (ve != null) {
- return Boolean.TRUE.equals(ve.getValue(context.getELContext()));
- }
-
- return false;
- }
-
- public void setExpanded(boolean newValue) {
- getStateHelper().put(PropertyKeys.expanded, this.getClientId(getFacesContext()), newValue);
- }
-
@Override
protected ExtendedDataModel<?> createExtendedDataModel() {
ExtendedTreeDataModelImpl<?> model = new ExtendedTreeDataModelImpl<TreeNode>(new SwingTreeNodeDataModelImpl());
@@ -243,7 +192,7 @@
return dataModel.getChildrenRowKeysIterator(rowKey);
}
- public AbstractTreeNode getTreeNodeComponent() {
+ public AbstractTreeNode findTreeNodeComponent() {
if (getChildCount() == 0) {
return null;
}
@@ -262,60 +211,7 @@
public void broadcast(FacesEvent event) throws AbortProcessingException {
super.broadcast(event);
- if (event instanceof TreeToggleEvent) {
- TreeToggleEvent toggleEvent = (TreeToggleEvent) event;
- boolean newExpandedValue = toggleEvent.isExpanded();
-
- FacesContext context = getFacesContext();
- ValueExpression expression = getValueExpression(PropertyKeys.expanded.toString());
- if (expression != null) {
- ELContext elContext = context.getELContext();
- Exception caught = null;
- FacesMessage message = null;
- try {
- expression.setValue(elContext, newExpandedValue);
- } catch (ELException e) {
- caught = e;
- String messageStr = e.getMessage();
- Throwable result = e.getCause();
- while (null != result &&
- result.getClass().isAssignableFrom(ELException.class)) {
- messageStr = result.getMessage();
- result = result.getCause();
- }
- if (null == messageStr) {
- MessageFactory messageFactory = ServiceTracker.getService(MessageFactory.class);
- message =
- messageFactory.createMessage(context, FacesMessages.UIINPUT_UPDATE,
- MessageUtil.getLabel(context, this));
- } else {
- message = new FacesMessage(FacesMessage.SEVERITY_ERROR,
- messageStr,
- messageStr);
- }
- } catch (Exception e) {
- caught = e;
- MessageFactory messageFactory = ServiceTracker.getService(MessageFactory.class);
- message =
- messageFactory.createMessage(context, FacesMessages.UIINPUT_UPDATE,
- MessageUtil.getLabel(context, this));
- }
- if (caught != null) {
- assert(message != null);
- UpdateModelException toQueue = new UpdateModelException(message, caught);
- ExceptionQueuedEventContext eventContext =
- new ExceptionQueuedEventContext(context,
- toQueue,
- this,
- PhaseId.UPDATE_MODEL_VALUES);
- context.getApplication().publishEvent(context,
- ExceptionQueuedEvent.class,
- eventContext);
- }
- } else {
- setExpanded(newExpandedValue);
- }
- } else if (event instanceof TreeSelectionEvent) {
+ if (event instanceof TreeSelectionEvent) {
TreeSelectionEvent selectionEvent = (TreeSelectionEvent) event;
final Collection<Object> newSelection = selectionEvent.getNewSelection();
@@ -335,20 +231,6 @@
}
@Override
- protected VisitResult visitDataChildrenMetaComponents(ExtendedVisitContext extendedVisitContext,
- VisitCallback callback) {
-
- if (ExtendedVisitContextMode.RENDER == extendedVisitContext.getVisitMode()) {
- VisitResult result = extendedVisitContext.invokeMetaComponentVisitCallback(this, callback, NODE_META_COMPONENT_ID);
- if (result != VisitResult.ACCEPT) {
- return result;
- }
- }
-
- return super.visitDataChildrenMetaComponents(extendedVisitContext, callback);
- }
-
- @Override
protected boolean visitFixedChildren(VisitContext visitContext, VisitCallback callback) {
if (visitContext instanceof ExtendedVisitContext) {
ExtendedVisitContext extendedVisitContext = (ExtendedVisitContext) visitContext;
@@ -373,7 +255,7 @@
}
public String resolveClientId(FacesContext facesContext, UIComponent contextComponent, String metaComponentId) {
- if (NODE_META_COMPONENT_ID.equals(metaComponentId) || SELECTION_META_COMPONENT_ID.equals(metaComponentId)) {
+ if (SELECTION_META_COMPONENT_ID.equals(metaComponentId)) {
return getClientId(facesContext) + MetaComponentResolver.META_COMPONENT_SEPARATOR_CHAR + metaComponentId;
}
@@ -388,12 +270,11 @@
@Override
protected Iterator<UIComponent> dataChildren() {
- AbstractTreeNode treeNodeComponent = getTreeNodeComponent();
+ AbstractTreeNode treeNodeComponent = findTreeNodeComponent();
if (treeNodeComponent != null) {
- return Iterators.<UIComponent>concat(Iterators.<UIComponent>singletonIterator(treeNodeComponent),
- Iterators.singletonIterator(treeDecoderHelper));
+ return Iterators.<UIComponent>singletonIterator(treeNodeComponent);
} else {
- return Iterators.<UIComponent>singletonIterator(treeDecoderHelper);
+ return Iterators.<UIComponent>emptyIterator();
}
}
@@ -402,18 +283,6 @@
return new TreeComponentState();
}
- public void addToggleListener(TreeToggleListener listener) {
- addFacesListener(listener);
- }
-
- public TreeToggleListener[] getTreeToggleListeners() {
- return (TreeToggleListener[]) getFacesListeners(TreeToggleListener.class);
- }
-
- public void removeToggleListener(TreeToggleListener listener) {
- removeFacesListener(listener);
- }
-
public void addSelectionListener(TreeSelectionListener listener) {
addFacesListener(listener);
}
@@ -425,4 +294,18 @@
public void removeSelectionListener(TreeSelectionListener listener) {
removeFacesListener(listener);
}
+
+ @Attribute(hidden = true)
+ public boolean isExpanded() {
+ if (getRowKey() == null) {
+ return true;
+ }
+
+ AbstractTreeNode treeNode = findTreeNodeComponent();
+ if (treeNode == null) {
+ return false;
+ }
+
+ return treeNode.isExpanded();
+ }
}
Modified: trunk/ui/iteration/ui/src/main/java/org/richfaces/component/AbstractTreeNode.java
===================================================================
--- trunk/ui/iteration/ui/src/main/java/org/richfaces/component/AbstractTreeNode.java 2010-11-05 16:32:09 UTC (rev 19968)
+++ trunk/ui/iteration/ui/src/main/java/org/richfaces/component/AbstractTreeNode.java 2010-11-05 16:48:06 UTC (rev 19969)
@@ -21,17 +21,39 @@
*/
package org.richfaces.component;
+import java.io.IOException;
+
+import javax.el.ELContext;
+import javax.el.ELException;
+import javax.el.ValueExpression;
+import javax.faces.application.FacesMessage;
import javax.faces.component.UIComponent;
import javax.faces.component.UIComponentBase;
+import javax.faces.component.UpdateModelException;
+import javax.faces.component.visit.VisitCallback;
+import javax.faces.component.visit.VisitContext;
+import javax.faces.component.visit.VisitResult;
+import javax.faces.context.FacesContext;
import javax.faces.event.AbortProcessingException;
+import javax.faces.event.ExceptionQueuedEvent;
+import javax.faces.event.ExceptionQueuedEventContext;
import javax.faces.event.FacesEvent;
import javax.faces.event.PhaseId;
+import org.ajax4jsf.component.IterationStateHolder;
+import org.richfaces.application.MessageFactory;
+import org.richfaces.application.ServiceTracker;
+import org.richfaces.appplication.FacesMessages;
import org.richfaces.cdk.annotations.Attribute;
import org.richfaces.cdk.annotations.JsfComponent;
import org.richfaces.cdk.annotations.JsfRenderer;
import org.richfaces.cdk.annotations.Tag;
+import org.richfaces.component.util.MessageUtil;
+import org.richfaces.context.ExtendedVisitContext;
+import org.richfaces.context.ExtendedVisitContextMode;
import org.richfaces.event.TreeToggleEvent;
+import org.richfaces.event.TreeToggleListener;
+import org.richfaces.renderkit.MetaComponentRenderer;
/**
* @author Nick Belaevski
@@ -43,12 +65,18 @@
tag = @Tag(name = "treeNode"),
renderer = @JsfRenderer(type = "org.richfaces.TreeNodeRenderer")
)
-public abstract class AbstractTreeNode extends UIComponentBase {
+public abstract class AbstractTreeNode extends UIComponentBase implements MetaComponentResolver, MetaComponentEncoder, IterationStateHolder {
public static final String COMPONENT_TYPE = "org.richfaces.TreeNode";
public static final String COMPONENT_FAMILY = "org.richfaces.TreeNode";
+ public static final String SUBTREE_META_COMPONENT_ID = "subtree";
+
+ private enum PropertyKeys {
+ expanded
+ }
+
public AbstractTreeNode() {
setRendererType("org.richfaces.TreeNodeRenderer");
}
@@ -66,7 +94,38 @@
//TODO - move to template
public abstract String getStyleClass();
- protected AbstractTree findTreeComponent() {
+ protected Boolean getLocalExpandedValue(FacesContext facesContext) {
+ return (Boolean) getStateHelper().get(PropertyKeys.expanded);
+ }
+
+ public boolean isExpanded() {
+ FacesContext context = getFacesContext();
+ Boolean localExpandedValue = getLocalExpandedValue(context);
+ if (localExpandedValue != null) {
+ return localExpandedValue.booleanValue();
+ }
+
+ ValueExpression ve = getValueExpression(PropertyKeys.expanded.toString());
+ if (ve != null) {
+ return Boolean.TRUE.equals(ve.getValue(context.getELContext()));
+ }
+
+ return false;
+ }
+
+ public void setExpanded(boolean newValue) {
+ getStateHelper().put(PropertyKeys.expanded, newValue);
+ }
+
+ public Object getIterationState() {
+ return getStateHelper().get(PropertyKeys.expanded);
+ }
+
+ public void setIterationState(Object state) {
+ getStateHelper().put(PropertyKeys.expanded, state);
+ }
+
+ public AbstractTree findTreeComponent() {
UIComponent c = this;
while (c != null && !(c instanceof AbstractTree)) {
c = c.getParent();
@@ -93,7 +152,103 @@
if (event instanceof TreeToggleEvent) {
TreeToggleEvent toggleEvent = (TreeToggleEvent) event;
- new TreeToggleEvent(findTreeComponent(), toggleEvent.isExpanded()).queue();
+ boolean newExpandedValue = toggleEvent.isExpanded();
+
+ FacesContext context = getFacesContext();
+ ValueExpression expression = getValueExpression(PropertyKeys.expanded.toString());
+ if (expression != null) {
+ ELContext elContext = context.getELContext();
+ Exception caught = null;
+ FacesMessage message = null;
+ try {
+ expression.setValue(elContext, newExpandedValue);
+ } catch (ELException e) {
+ caught = e;
+ String messageStr = e.getMessage();
+ Throwable result = e.getCause();
+ while (null != result &&
+ result.getClass().isAssignableFrom(ELException.class)) {
+ messageStr = result.getMessage();
+ result = result.getCause();
+ }
+ if (null == messageStr) {
+ MessageFactory messageFactory = ServiceTracker.getService(MessageFactory.class);
+ message =
+ messageFactory.createMessage(context, FacesMessages.UIINPUT_UPDATE,
+ MessageUtil.getLabel(context, this));
+ } else {
+ message = new FacesMessage(FacesMessage.SEVERITY_ERROR,
+ messageStr,
+ messageStr);
+ }
+ } catch (Exception e) {
+ caught = e;
+ MessageFactory messageFactory = ServiceTracker.getService(MessageFactory.class);
+ message =
+ messageFactory.createMessage(context, FacesMessages.UIINPUT_UPDATE,
+ MessageUtil.getLabel(context, this));
+ }
+ if (caught != null) {
+ assert(message != null);
+ UpdateModelException toQueue = new UpdateModelException(message, caught);
+ ExceptionQueuedEventContext eventContext =
+ new ExceptionQueuedEventContext(context,
+ toQueue,
+ this,
+ PhaseId.UPDATE_MODEL_VALUES);
+ context.getApplication().publishEvent(context,
+ ExceptionQueuedEvent.class,
+ eventContext);
+ }
+ } else {
+ setExpanded(newExpandedValue);
+ }
}
}
+
+ public void addToggleListener(TreeToggleListener listener) {
+ addFacesListener(listener);
+ }
+
+ public TreeToggleListener[] getTreeToggleListeners() {
+ return (TreeToggleListener[]) getFacesListeners(TreeToggleListener.class);
+ }
+
+ public void removeToggleListener(TreeToggleListener listener) {
+ removeFacesListener(listener);
+ }
+
+ public String resolveClientId(FacesContext facesContext, UIComponent contextComponent, String metaComponentId) {
+ if (SUBTREE_META_COMPONENT_ID.equals(metaComponentId)) {
+ return getClientId(facesContext) + MetaComponentResolver.META_COMPONENT_SEPARATOR_CHAR + metaComponentId;
+ }
+
+ return null;
+ }
+
+ public String substituteUnresolvedClientId(FacesContext facesContext, UIComponent contextComponent,
+ String metaComponentId) {
+
+ return null;
+ }
+
+ @Override
+ public boolean visitTree(VisitContext context, VisitCallback callback) {
+ if (context instanceof ExtendedVisitContext) {
+ ExtendedVisitContext extendedVisitContext = (ExtendedVisitContext) context;
+ if (extendedVisitContext.getVisitMode() == ExtendedVisitContextMode.RENDER) {
+ VisitResult result = extendedVisitContext.invokeMetaComponentVisitCallback(this, callback, SUBTREE_META_COMPONENT_ID);
+
+ if (result != VisitResult.ACCEPT) {
+ return result == VisitResult.COMPLETE;
+ }
+ }
+ }
+
+ return super.visitTree(context, callback);
+ }
+
+ public void encodeMetaComponent(FacesContext context, String metaComponentId) throws IOException {
+ ((MetaComponentRenderer) getRenderer(context)).encodeMetaComponent(context, this, metaComponentId);
+ }
}
Deleted: trunk/ui/iteration/ui/src/main/java/org/richfaces/component/TreeDecoderHelper.java
===================================================================
--- trunk/ui/iteration/ui/src/main/java/org/richfaces/component/TreeDecoderHelper.java 2010-11-05 16:32:09 UTC (rev 19968)
+++ trunk/ui/iteration/ui/src/main/java/org/richfaces/component/TreeDecoderHelper.java 2010-11-05 16:48:06 UTC (rev 19969)
@@ -1,66 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat, Inc. and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.richfaces.component;
-
-import javax.faces.component.UIComponent;
-import javax.faces.component.UIComponentBase;
-import javax.faces.context.FacesContext;
-
-/**
- * @author Nick Belaevski
- *
- */
-public class TreeDecoderHelper extends UIComponentBase {
-
- public static final String HELPER_ID = "__treeDecoderHelper";
-
- private AbstractTree tree;
-
- public TreeDecoderHelper(AbstractTree tree) {
- super();
- this.tree = tree;
-
- setId(HELPER_ID);
- setTransient(true);
- }
-
- @Override
- public UIComponent getParent() {
- return tree;
- }
-
- @Override
- public boolean isInView() {
- return tree.isInView();
- }
-
- @Override
- public String getFamily() {
- return null;
- }
-
- @Override
- public void decode(FacesContext context) {
- super.decode(context);
- tree.decodeMetaComponent(context, AbstractTree.NODE_META_COMPONENT_ID);
- }
-}
Modified: trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/TreeEncoderBase.java
===================================================================
--- trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/TreeEncoderBase.java 2010-11-05 16:32:09 UTC (rev 19968)
+++ trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/TreeEncoderBase.java 2010-11-05 16:48:06 UTC (rev 19969)
@@ -29,6 +29,7 @@
import javax.faces.context.ResponseWriter;
import org.richfaces.component.AbstractTree;
+import org.richfaces.component.AbstractTreeNode;
import org.richfaces.component.TreeRange;
import org.richfaces.component.util.HtmlUtil;
import org.richfaces.renderkit.TreeRendererBase.NodeState;
@@ -72,7 +73,7 @@
return false;
}
- return tree.getTreeNodeComponent() != null;
+ return tree.findTreeNodeComponent() != null;
}
};
@@ -117,6 +118,8 @@
}
protected void writeTreeNodeStartElement(NodeState nodeState, boolean isLast) throws IOException {
+ AbstractTreeNode treeNodeComponent = tree.findTreeNodeComponent();
+
context.getAttributes().put(TREE_NODE_HANDLE_CLASS_ATTRIBUTE, nodeState.getHandleClass());
context.getAttributes().put(TREE_NODE_ICON_CLASS_ATTRIBUTE, nodeState.getIconClass());
@@ -124,9 +127,9 @@
responseWriter.writeAttribute(HtmlConstants.CLASS_ATTRIBUTE,
HtmlUtil.concatClasses("rf-tr-nd", isLast ? "rf-tr-nd-last" : null, nodeState.getNodeClass()),
null);
- responseWriter.writeAttribute(HtmlConstants.ID_ATTRIBUTE, tree.getClientId(context), null);
+ responseWriter.writeAttribute(HtmlConstants.ID_ATTRIBUTE, treeNodeComponent.getClientId(context), null);
- tree.getTreeNodeComponent().encodeAll(context);
+ treeNodeComponent.encodeAll(context);
}
protected void writeTreeNodeEndElement() throws IOException {
Modified: trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/TreeEncoderPartial.java
===================================================================
--- trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/TreeEncoderPartial.java 2010-11-05 16:32:09 UTC (rev 19968)
+++ trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/TreeEncoderPartial.java 2010-11-05 16:48:06 UTC (rev 19969)
@@ -27,7 +27,7 @@
import javax.faces.context.PartialResponseWriter;
import org.ajax4jsf.javascript.JSFunction;
-import org.richfaces.component.AbstractTree;
+import org.richfaces.component.AbstractTreeNode;
/**
* @author Nick Belaevski
@@ -35,11 +35,15 @@
*/
class TreeEncoderPartial extends TreeEncoderBase {
+ protected final AbstractTreeNode treeNode;
+
private Object rowKey;
- public TreeEncoderPartial(FacesContext context, AbstractTree tree) {
- super(context, tree);
+ public TreeEncoderPartial(FacesContext context, AbstractTreeNode treeNode) {
+ super(context, treeNode.findTreeComponent());
+ this.treeNode = treeNode;
+
this.rowKey = tree.getRowKey();
if (this.rowKey == null) {
@@ -49,8 +53,10 @@
@Override
public void encode() throws IOException {
+ String elementId = treeNode.getClientId(context);
+
PartialResponseWriter prw = context.getPartialViewContext().getPartialResponseWriter();
- prw.startUpdate(tree.getClientId(context));
+ prw.startUpdate(elementId);
Object initialRowKey = tree.getRowKey();
try {
@@ -68,7 +74,7 @@
}
prw.startEval();
- JSFunction function = new JSFunction("RichFaces.ui.TreeNode.initNodeByAjax", tree.getClientId(context));
+ JSFunction function = new JSFunction("RichFaces.ui.TreeNode.initNodeByAjax", elementId);
prw.write(function.toScript());
prw.endEval();
}
Added: trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/TreeNodeRendererBase.java
===================================================================
--- trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/TreeNodeRendererBase.java (rev 0)
+++ trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/TreeNodeRendererBase.java 2010-11-05 16:48:06 UTC (rev 19969)
@@ -0,0 +1,82 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc. and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.richfaces.renderkit;
+
+import java.io.IOException;
+import java.util.Map;
+
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.context.PartialViewContext;
+
+import org.richfaces.component.AbstractTreeNode;
+import org.richfaces.component.MetaComponentResolver;
+import org.richfaces.event.TreeToggleEvent;
+
+/**
+ * @author Nick Belaevski
+ *
+ */
+public class TreeNodeRendererBase extends RendererBase implements MetaComponentRenderer {
+
+ private static final String NEW_NODE_TOGGLE_STATE = "__NEW_NODE_TOGGLE_STATE";
+
+ private static final String TRIGGER_NODE_AJAX_UPDATE = "__TRIGGER_NODE_AJAX_UPDATE";
+
+ @Override
+ public void decode(FacesContext context, UIComponent component) {
+ super.decode(context, component);
+
+ final Map<String, String> map = context.getExternalContext().getRequestParameterMap();
+ String newToggleState = map.get(component.getClientId(context) + NEW_NODE_TOGGLE_STATE);
+ if (newToggleState != null) {
+
+ AbstractTreeNode treeNode = (AbstractTreeNode) component;
+
+ boolean expanded = Boolean.valueOf(newToggleState);
+ if (treeNode.isExpanded() ^ expanded) {
+ new TreeToggleEvent(treeNode, expanded).queue();
+ }
+
+ PartialViewContext pvc = context.getPartialViewContext();
+ if (pvc.isAjaxRequest() && map.get(component.getClientId(context) + TRIGGER_NODE_AJAX_UPDATE) != null) {
+ pvc.getRenderIds().add(treeNode.getClientId(context) + MetaComponentResolver.META_COMPONENT_SEPARATOR_CHAR + AbstractTreeNode.SUBTREE_META_COMPONENT_ID);
+ }
+ }
+ }
+
+ public void decodeMetaComponent(FacesContext context, UIComponent component, String metaComponentId) {
+ throw new UnsupportedOperationException();
+ }
+
+ public void encodeMetaComponent(FacesContext context, UIComponent component, String metaComponentId)
+ throws IOException {
+
+ if (AbstractTreeNode.SUBTREE_META_COMPONENT_ID.equals(metaComponentId)) {
+ AbstractTreeNode treeNode = (AbstractTreeNode) component;
+ new TreeEncoderPartial(context, treeNode).encode();
+ } else {
+ throw new IllegalArgumentException(metaComponentId);
+ }
+
+ }
+}
Modified: trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/TreeRendererBase.java
===================================================================
--- trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/TreeRendererBase.java 2010-11-05 16:32:09 UTC (rev 19968)
+++ trunk/ui/iteration/ui/src/main/java/org/richfaces/renderkit/TreeRendererBase.java 2010-11-05 16:48:06 UTC (rev 19969)
@@ -21,7 +21,6 @@
*/
package org.richfaces.renderkit;
-import static org.richfaces.component.AbstractTree.NODE_META_COMPONENT_ID;
import static org.richfaces.component.AbstractTree.SELECTION_META_COMPONENT_ID;
import static org.richfaces.renderkit.util.AjaxRendererUtils.AJAX_FUNCTION_NAME;
import static org.richfaces.renderkit.util.AjaxRendererUtils.buildAjaxFunction;
@@ -33,8 +32,8 @@
import java.util.Iterator;
import java.util.Map;
+import javax.faces.component.ContextCallback;
import javax.faces.component.UIComponent;
-import javax.faces.component.UINamingContainer;
import javax.faces.context.FacesContext;
import javax.faces.context.PartialResponseWriter;
import javax.faces.context.PartialViewContext;
@@ -46,9 +45,7 @@
import org.richfaces.component.AbstractTreeNode;
import org.richfaces.component.MetaComponentResolver;
import org.richfaces.component.SwitchType;
-import org.richfaces.component.TreeDecoderHelper;
import org.richfaces.event.TreeSelectionEvent;
-import org.richfaces.event.TreeToggleEvent;
import org.richfaces.log.Logger;
import org.richfaces.log.RichfacesLogger;
@@ -68,10 +65,25 @@
private static final JSReference SOURCE_JS_REF = new JSReference("source");
- private static final String NEW_NODE_TOGGLE_STATE = "__NEW_NODE_TOGGLE_STATE";
-
private static final String SELECTION_STATE = "__SELECTION_STATE";
+ /**
+ * @author Nick Belaevski
+ *
+ */
+ private final class RowKeyContextCallback implements ContextCallback {
+ private Object rowKey;
+
+ public void invokeContextCallback(FacesContext context, UIComponent target) {
+ AbstractTreeNode treeNode = (AbstractTreeNode) target;
+ rowKey = treeNode.findTreeComponent().getRowKey();
+ }
+
+ public Object getRowKey() {
+ return rowKey;
+ }
+ }
+
enum NodeState {
expanded("rf-tr-nd-exp", "rf-trn-hnd-exp", "rf-trn-ico-nd"),
collapsed("rf-tr-nd-colps", "rf-trn-hnd-colps", "rf-trn-ico-nd"),
@@ -146,10 +158,6 @@
new TreeEncoderFull(context, tree).encode();
}
- protected String getDecoderHelperId(FacesContext facesContext) {
- return UINamingContainer.getSeparatorChar(facesContext) + TreeDecoderHelper.HELPER_ID;
- }
-
protected String getAjaxSubmitFunction(FacesContext context, UIComponent component) {
AbstractTree tree = (AbstractTree) component;
@@ -189,7 +197,7 @@
try {
tree.setRowKey(context, selectionKey);
if (tree.isRowAvailable()) {
- selectedNodeId = tree.getClientId(context);
+ selectedNodeId = tree.findTreeNodeComponent().getClientId(context);
}
} finally {
try {
@@ -226,20 +234,10 @@
return selectionType;
}
- protected String getNamingContainerSeparatorChar(FacesContext context) {
- return String.valueOf(UINamingContainer.getSeparatorChar(context));
- }
-
- /* (non-Javadoc)
- * @see org.richfaces.renderkit.MetaComponentRenderer#encodeMetaComponent(javax.faces.context.FacesContext, javax.faces.component.UIComponent, java.lang.String)
- */
public void encodeMetaComponent(FacesContext context, UIComponent component, String metaComponentId)
throws IOException {
- if (NODE_META_COMPONENT_ID.equals(metaComponentId)) {
- AbstractTree tree = (AbstractTree) component;
- new TreeEncoderPartial(context, tree).encode();
- } else if (SELECTION_META_COMPONENT_ID.equals(metaComponentId)) {
+ if (SELECTION_META_COMPONENT_ID.equals(metaComponentId)) {
PartialResponseWriter writer = context.getPartialViewContext().getPartialResponseWriter();
writer.startUpdate(getSelectionStateInputId(context, component));
@@ -261,30 +259,7 @@
}
public void decodeMetaComponent(FacesContext context, UIComponent component, String metaComponentId) {
- if (NODE_META_COMPONENT_ID.equals(metaComponentId)) {
- final Map<String, String> map = context.getExternalContext().getRequestParameterMap();
- String newToggleState = map.get(component.getClientId(context) + NEW_NODE_TOGGLE_STATE);
- if (newToggleState != null) {
-
- AbstractTree tree = (AbstractTree) component;
- AbstractTreeNode treeNode = tree.getTreeNodeComponent();
-
- if (treeNode == null) {
- return;
- }
-
- boolean expanded = Boolean.valueOf(newToggleState);
- if (tree.isExpanded() ^ expanded) {
- new TreeToggleEvent(treeNode, expanded).queue();
- }
-
- PartialViewContext pvc = context.getPartialViewContext();
- if (pvc.isAjaxRequest()) {
- pvc.getRenderIds().add(tree.getClientId(context) + MetaComponentResolver.META_COMPONENT_SEPARATOR_CHAR
- + AbstractTree.NODE_META_COMPONENT_ID);
- }
- }
- }
+ throw new UnsupportedOperationException();
}
@Override
@@ -298,8 +273,9 @@
Object selectionRowKey = null;
if (!Strings.isNullOrEmpty(selectedNode)) {
- String selectionRowKeyString = selectedNode.substring(component.getClientId(context).length() + 1 /* naming container separator char */);
- selectionRowKey = tree.getRowKeyConverter().getAsObject(context, component, selectionRowKeyString);
+ RowKeyContextCallback rowKeyContextCallback = new RowKeyContextCallback();
+ tree.invokeOnComponent(context, selectedNode, rowKeyContextCallback);
+ selectionRowKey = rowKeyContextCallback.getRowKey();
}
Collection<Object> selection = tree.getSelection();
Modified: trunk/ui/iteration/ui/src/main/resources/META-INF/resources/org.richfaces/tree.js
===================================================================
--- trunk/ui/iteration/ui/src/main/resources/META-INF/resources/org.richfaces/tree.js 2010-11-05 16:32:09 UTC (rev 19968)
+++ trunk/ui/iteration/ui/src/main/resources/META-INF/resources/org.richfaces/tree.js 2010-11-05 16:48:06 UTC (rev 19969)
@@ -21,10 +21,10 @@
*/
(function($, richfaces) {
- var DECODER_HELPER_ID = "__treeDecoderHelper";
-
var NEW_NODE_TOGGLE_STATE = "__NEW_NODE_TOGGLE_STATE";
+ var TRIGGER_NODE_AJAX_UPDATE = "__TRIGGER_NODE_AJAX_UPDATE";
+
var SELECTION_STATE = "__SELECTION_STATE";
var TREE_CLASSES = ["rf-tr-nd-colps", "rf-tr-nd-exp"];
@@ -233,8 +233,6 @@
return tree != findTree(elt);
};
- var ncSepChar;
-
richfaces.ui.Tree = richfaces.ui.TreeNode.extendClass({
name: "Tree",
@@ -304,7 +302,8 @@
var form = this.__treeRootElt.closest('form');
richfaces.submitForm(form, clientParams);
} else {
- this.__ajaxSubmitFunction(event, toggleSource + ncSepChar + DECODER_HELPER_ID, clientParams);
+ clientParams[toggleSource + TRIGGER_NODE_AJAX_UPDATE] = newNodeState;
+ this.__ajaxSubmitFunction(event, toggleSource, clientParams);
}
},
@@ -376,8 +375,4 @@
}
});
- richfaces.ui.Tree.setNamingContainerSeparatorChar = function(s) {
- ncSepChar = s.charAt(0);
- };
-
}(jQuery, RichFaces));
\ No newline at end of file
Modified: trunk/ui/iteration/ui/src/main/templates/tree.template.xml
===================================================================
--- trunk/ui/iteration/ui/src/main/templates/tree.template.xml 2010-11-05 16:32:09 UTC (rev 19968)
+++ trunk/ui/iteration/ui/src/main/templates/tree.template.xml 2010-11-05 16:48:06 UTC (rev 19969)
@@ -29,7 +29,6 @@
<cdk:call expression="encodeSelectionStateInput(facesContext, component)" />
<script type="text/javascript">
- RichFaces.ui.Tree.setNamingContainerSeparatorChar(#{toScriptArgs(getNamingContainerSeparatorChar(facesContext))});
<cdk:scriptObject name="options">
<cdk:scriptOption attributes="toggleType" defaultValue="SwitchType.DEFAULT" />
<cdk:scriptOption name="selectionType" value="#{getSelectionMode(facesContext, component)}" defaultValue="SwitchType.client" />
Modified: trunk/ui/iteration/ui/src/main/templates/treeNode.template.xml
===================================================================
--- trunk/ui/iteration/ui/src/main/templates/treeNode.template.xml 2010-11-05 16:32:09 UTC (rev 19968)
+++ trunk/ui/iteration/ui/src/main/templates/treeNode.template.xml 2010-11-05 16:48:06 UTC (rev 19969)
@@ -8,7 +8,7 @@
<cc:interface>
<cdk:class>org.richfaces.renderkit.html.TreeNodeRenderer
</cdk:class>
- <cdk:superclass>org.richfaces.renderkit.RendererBase</cdk:superclass>
+ <cdk:superclass>org.richfaces.renderkit.TreeNodeRendererBase</cdk:superclass>
<cdk:component-family>org.richfaces.TreeNode
</cdk:component-family>
<cdk:renderer-type>org.richfaces.TreeNodeRenderer
13 years, 8 months
JBoss Rich Faces SVN: r19968 - trunk/examples/richfaces-showcase/src/main/webapp/richfaces/tooltip/samples.
by richfaces-svn-commits@lists.jboss.org
Author: pyaschenko
Date: 2010-11-05 12:32:09 -0400 (Fri, 05 Nov 2010)
New Revision: 19968
Modified:
trunk/examples/richfaces-showcase/src/main/webapp/richfaces/tooltip/samples/tooltip-sample.xhtml
Log:
small fix
Modified: trunk/examples/richfaces-showcase/src/main/webapp/richfaces/tooltip/samples/tooltip-sample.xhtml
===================================================================
--- trunk/examples/richfaces-showcase/src/main/webapp/richfaces/tooltip/samples/tooltip-sample.xhtml 2010-11-05 15:19:21 UTC (rev 19967)
+++ trunk/examples/richfaces-showcase/src/main/webapp/richfaces/tooltip/samples/tooltip-sample.xhtml 2010-11-05 16:32:09 UTC (rev 19968)
@@ -34,7 +34,7 @@
<rich:panel id="sample1" styleClass="tooltip-text"
bodyClass="rich-laguna-panel-no-header">
<p>Here you can see <b>default client-side</b> tool-tip</p>
- <rich:tooltip id="tt1" styleClass="tooltip">
+ <rich:tooltip id="tt1" styleClass="tooltip" layout="block">
<span style="white-space: nowrap"> This tool-tip content was
<strong>pre-rendered</strong> to the page.<br />
Also the tooltip following mouse by default </span>
@@ -45,7 +45,7 @@
<p>This tool-tip will not <b>follow mouse</b>. Also this tool-tip
has a <b>delay 1.5 sec</b>, so be patient!</p>
<rich:tooltip followMouse="false" showDelay="1500"
- styleClass="tooltip-custom-body">
+ styleClass="tooltip-custom-body" layout="block">
<span style="white-space: nowrap"> This tool-tip content also
<strong>pre-rendered</strong> to the page.<br />
</span>
13 years, 8 months
JBoss Rich Faces SVN: r19967 - in modules/tests/metamer/trunk: ftest-source and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: lfryc(a)redhat.com
Date: 2010-11-05 11:19:21 -0400 (Fri, 05 Nov 2010)
New Revision: 19967
Modified:
modules/tests/metamer/trunk/ftest-source/pom.xml
modules/tests/metamer/trunk/ftest/pom.xml
Log:
tied to richfaces-selenium 1.5.2.SP1
Modified: modules/tests/metamer/trunk/ftest/pom.xml
===================================================================
--- modules/tests/metamer/trunk/ftest/pom.xml 2010-11-05 15:18:53 UTC (rev 19966)
+++ modules/tests/metamer/trunk/ftest/pom.xml 2010-11-05 15:19:21 UTC (rev 19967)
@@ -25,7 +25,7 @@
<parent>
<artifactId>functional-test-jboss-ci-template</artifactId>
<groupId>org.jboss.test.richfaces-selenium</groupId>
- <version>1.5.3-SNAPSHOT</version>
+ <version>1.5.2.SP1</version>
</parent>
<groupId>org.richfaces.tests</groupId>
Modified: modules/tests/metamer/trunk/ftest-source/pom.xml
===================================================================
--- modules/tests/metamer/trunk/ftest-source/pom.xml 2010-11-05 15:18:53 UTC (rev 19966)
+++ modules/tests/metamer/trunk/ftest-source/pom.xml 2010-11-05 15:19:21 UTC (rev 19967)
@@ -37,7 +37,7 @@
<dependency>
<artifactId>root</artifactId>
<groupId>org.jboss.test.richfaces-selenium</groupId>
- <version>1.5.3-SNAPSHOT</version>
+ <version>1.5.2.SP1</version>
<scope>import</scope>
<type>pom</type>
</dependency>
13 years, 8 months
JBoss Rich Faces SVN: r19966 - in modules/tests/metamer/trunk: ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInputNumberSpinner and 1 other directory.
by richfaces-svn-commits@lists.jboss.org
Author: lfryc(a)redhat.com
Date: 2010-11-05 11:18:53 -0400 (Fri, 05 Nov 2010)
New Revision: 19966
Modified:
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/richInputNumberSpinner/TestRichSpinner.java
Log:
fixed rich:collapsiblePanel tests failing due to failed location using rich:componentId in iteration components
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 2010-11-05 15:18:00 UTC (rev 19965)
+++ modules/tests/metamer/trunk/application/src/main/webapp/components/richCollapsiblePanel/simple.xhtml 2010-11-05 15:18:53 UTC (rev 19966)
@@ -37,14 +37,10 @@
</ui:define>
<ui:define name="outOfTemplateBefore">
- <script type="text/javascript">
- testedComponentId = "#{rich:clientId('collapsiblePanel')}";
- </script>
</ui:define>
<ui:define name="component">
- #{nonexistingbean.aaa}
-
+
<rich:collapsiblePanel id="collapsiblePanel"
bodyClass="#{richCollapsiblePanelBean.attributes['bodyClass'].value}"
bypassUpdates="#{richCollapsiblePanelBean.attributes['bypassUpdates'].value}"
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInputNumberSpinner/TestRichSpinner.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInputNumberSpinner/TestRichSpinner.java 2010-11-05 15:18:00 UTC (rev 19965)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/richInputNumberSpinner/TestRichSpinner.java 2010-11-05 15:18:53 UTC (rev 19966)
@@ -516,8 +516,7 @@
* @return spinner input value
*/
private String getInputValue() {
- String id = selenium.getEval(new JavaScript("window.testedComponentId"));
- return selenium.getEval(new JavaScript("window.RichFaces.$('" + id + "').value"));
+ return selenium.getValue(input);
}
/**
13 years, 8 months
JBoss Rich Faces SVN: r19965 - modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jPoll.
by richfaces-svn-commits@lists.jboss.org
Author: lfryc(a)redhat.com
Date: 2010-11-05 11:18:00 -0400 (Fri, 05 Nov 2010)
New Revision: 19965
Modified:
modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jPoll/TestInterval.java
Log:
a4j:poll - TestInterval - interval deviation increased from one to two intervals (the validation of functionality itself is in validateAverageDeviation()
Modified: modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jPoll/TestInterval.java
===================================================================
--- modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jPoll/TestInterval.java 2010-11-05 15:17:18 UTC (rev 19964)
+++ modules/tests/metamer/trunk/ftest-source/src/main/java/org/richfaces/tests/metamer/ftest/a4jPoll/TestInterval.java 2010-11-05 15:18:00 UTC (rev 19965)
@@ -143,8 +143,8 @@
System.out.println(format("deviation for interval {0}: {1}", interval, deviation));
}
- assertTrue(deviation <= interval,
- format("Deviation ({0}) is greater than one interval {1}", deviation, interval));
+ assertTrue(deviation <= (2 * interval),
+ format("Deviation ({0}) is greater than two intervals (2 * {1})", deviation, interval));
deviationTotal += deviation;
deviationCount += 1;
13 years, 8 months