You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by mb...@apache.org on 2007/03/13 16:09:39 UTC

svn commit: r517721 - /myfaces/core/branches/jsf12/api/src/main/java-templates/javax/faces/component/UICommandTemplate.java

Author: mbr
Date: Tue Mar 13 08:09:39 2007
New Revision: 517721

URL: http://svn.apache.org/viewvc?view=rev&rev=517721
Log:
added null value handling for set/get action

Modified:
    myfaces/core/branches/jsf12/api/src/main/java-templates/javax/faces/component/UICommandTemplate.java

Modified: myfaces/core/branches/jsf12/api/src/main/java-templates/javax/faces/component/UICommandTemplate.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/jsf12/api/src/main/java-templates/javax/faces/component/UICommandTemplate.java?view=diff&rev=517721&r1=517720&r2=517721
==============================================================================
--- myfaces/core/branches/jsf12/api/src/main/java-templates/javax/faces/component/UICommandTemplate.java (original)
+++ myfaces/core/branches/jsf12/api/src/main/java-templates/javax/faces/component/UICommandTemplate.java Tue Mar 13 08:09:39 2007
@@ -44,7 +44,14 @@
      */
     public void setAction(MethodBinding action)
     {
-        setActionExpression(new _MethodBindingToMethodExpression(action));
+        if(action != null)
+        {
+            setActionExpression(new _MethodBindingToMethodExpression(action));
+        } 
+        else
+        {
+            setActionExpression(null);
+        }
     }
 
     /**
@@ -56,8 +63,11 @@
         if (actionExpression instanceof _MethodBindingToMethodExpression) {
             return ((_MethodBindingToMethodExpression)actionExpression).getMethodBinding();
         }
-
-        return new _MethodExpressionToMethodBinding(actionExpression);
+        if(actionExpression != null)
+        {
+            return new _MethodExpressionToMethodBinding(actionExpression);
+        }
+        return null;
     }
 
     @Override
@@ -69,10 +79,11 @@
         if (event instanceof ActionEvent)
         {
             FacesContext context = getFacesContext();
-
-            for (ActionListener listener : getActionListeners())
+            
+            MethodBinding mb = getActionListener();
+            if(mb != null)
             {
-                listener.processAction((ActionEvent)event);
+                mb.invoke(context, new Object[] { event });
             }
 
             ActionListener defaultActionListener