You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lo...@apache.org on 2011/08/16 16:20:06 UTC

svn commit: r1158287 - in /myfaces/tobago/trunk/tobago-example: tobago-example-data/src/main/java/org/apache/myfaces/tobago/example/data/NamedNode.java tobago-example-demo/src/main/webapp/content/03/01/treeMenu-different-types.xhtml

Author: lofwyr
Date: Tue Aug 16 14:20:05 2011
New Revision: 1158287

URL: http://svn.apache.org/viewvc?rev=1158287&view=rev
Log:
Tree example with actionListener

Modified:
    myfaces/tobago/trunk/tobago-example/tobago-example-data/src/main/java/org/apache/myfaces/tobago/example/data/NamedNode.java
    myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/03/01/treeMenu-different-types.xhtml

Modified: myfaces/tobago/trunk/tobago-example/tobago-example-data/src/main/java/org/apache/myfaces/tobago/example/data/NamedNode.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-data/src/main/java/org/apache/myfaces/tobago/example/data/NamedNode.java?rev=1158287&r1=1158286&r2=1158287&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-data/src/main/java/org/apache/myfaces/tobago/example/data/NamedNode.java (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-data/src/main/java/org/apache/myfaces/tobago/example/data/NamedNode.java Tue Aug 16 14:20:05 2011
@@ -20,6 +20,7 @@ package org.apache.myfaces.tobago.exampl
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import javax.faces.event.ActionEvent;
 import javax.swing.tree.DefaultMutableTreeNode;
 
 public class NamedNode extends DefaultMutableTreeNode {
@@ -51,6 +52,10 @@ public class NamedNode extends DefaultMu
     return null;
   }
 
+  public void actionListener(ActionEvent event) {
+    LOG.info("The actionListener() of node '" + name + "' was called.");
+  }
+
   public String getScript() {
     return script;
   }

Modified: myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/03/01/treeMenu-different-types.xhtml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/03/01/treeMenu-different-types.xhtml?rev=1158287&r1=1158286&r2=1158287&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/03/01/treeMenu-different-types.xhtml (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/content/03/01/treeMenu-different-types.xhtml Tue Aug 16 14:20:05 2011
@@ -30,6 +30,7 @@
         <tc:treeNode id="template" expanded="true">
           <tc:treeCommand label="#{node.name}" rendered="#{node.childCount == 0}"
                           action="#{node.action}"
+                          actionListener="#{node.actionListener}"
                           link="#{node.url}"
                           onclick="#{node.script}"/>
           <tc:treeLabel value="#{node.name}" rendered="#{node.childCount > 0}"/>