You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by ms...@apache.org on 2010/03/08 17:58:30 UTC
svn commit: r920396 -
/myfaces/trinidad/branches/trinidad-2.0.x/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/htmlBasic/ComponentFacesBean.java
Author: mstarets
Date: Mon Mar 8 16:58:30 2010
New Revision: 920396
URL: http://svn.apache.org/viewvc?rev=920396&view=rev
Log:
TRINIDAD-1749 - Trinidad 2: UnsupportedOperationException during decode when h:form is on the page
Implemented getClientBehaviors() to delegate to the component if it implements ClientBehaviorHolder, and return an empty map otherwise
Modified:
myfaces/trinidad/branches/trinidad-2.0.x/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/htmlBasic/ComponentFacesBean.java
Modified: myfaces/trinidad/branches/trinidad-2.0.x/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/htmlBasic/ComponentFacesBean.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/trinidad-2.0.x/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/htmlBasic/ComponentFacesBean.java?rev=920396&r1=920395&r2=920396&view=diff
==============================================================================
--- myfaces/trinidad/branches/trinidad-2.0.x/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/htmlBasic/ComponentFacesBean.java (original)
+++ myfaces/trinidad/branches/trinidad-2.0.x/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/renderkit/htmlBasic/ComponentFacesBean.java Mon Mar 8 16:58:30 2010
@@ -18,6 +18,7 @@
*/
package org.apache.myfaces.trinidadinternal.renderkit.htmlBasic;
+import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
@@ -27,6 +28,7 @@
import javax.faces.component.UIComponent;
import javax.faces.component.behavior.ClientBehavior;
+import javax.faces.component.behavior.ClientBehaviorHolder;
import javax.faces.context.FacesContext;
import javax.faces.el.ValueBinding;
@@ -57,6 +59,16 @@
{
return _component.getAttributes().get(key.getName());
}
+
+ public Map<String, List<ClientBehavior>> getClientBehaviors()
+ {
+ Map<String, List<ClientBehavior>> behaviors = _EMPTY_CLIENT_BEHAVIORS_MAP;
+ if (_component instanceof ClientBehaviorHolder)
+ {
+ behaviors = ((ClientBehaviorHolder)_component).getClientBehaviors();
+ }
+ return behaviors;
+ }
/**
* @todo Need *good* way of hooking property-sets; it's
@@ -175,10 +187,7 @@
throw new UnsupportedOperationException();
}
- public Map<String, List<ClientBehavior>> getClientBehaviors()
- {
- throw new UnsupportedOperationException();
- }
-
private final UIComponent _component;
+
+ private static final Map<String, List<ClientBehavior>> _EMPTY_CLIENT_BEHAVIORS_MAP = Collections.emptyMap();
}