You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by ma...@apache.org on 2009/01/30 15:24:50 UTC

svn commit: r739290 - /myfaces/trinidad/trunk/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/menu/ItemNode.java

Author: matzew
Date: Fri Jan 30 14:24:50 2009
New Revision: 739290

URL: http://svn.apache.org/viewvc?rev=739290&view=rev
Log:
TRINIDAD-1369 - XMLMenuModel:No support for actionListener

thanks to Abhijit S Ghosh for the patch 

Modified:
    myfaces/trinidad/trunk/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/menu/ItemNode.java

Modified: myfaces/trinidad/trunk/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/menu/ItemNode.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/trunk/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/menu/ItemNode.java?rev=739290&r1=739289&r2=739290&view=diff
==============================================================================
--- myfaces/trinidad/trunk/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/menu/ItemNode.java (original)
+++ myfaces/trinidad/trunk/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/menu/ItemNode.java Fri Jan 30 14:24:50 2009
@@ -21,6 +21,7 @@
 import java.util.Map;
 
 import javax.faces.context.FacesContext;
+import javax.faces.event.ActionEvent;
 import javax.faces.el.MethodBinding;
 import javax.faces.webapp.UIComponentTag;
 
@@ -122,6 +123,18 @@
     return value;
   }
   
+  public void actionListener(ActionEvent event)
+  {
+    String listener = _actionListener;
+    if (listener != null && UIComponentTag.isValueReference(listener)) 
+    {
+      FacesContext facesContext = FacesContext.getCurrentInstance();
+      MethodBinding methodBinding = facesContext.getApplication()
+      .createMethodBinding(listener,new Class[] { ActionEvent.class });
+      methodBinding.invoke(facesContext, new Object[] { event });
+    }
+  }
+  
   /**
     * setLaunchListener - sets the value of the Menu Node's launchListener
     * atribute.