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 2013/01/21 15:23:34 UTC

svn commit: r1436364 - /myfaces/tobago/branches/tobago-1.5.x/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/NavigationState.java

Author: lofwyr
Date: Mon Jan 21 14:23:33 2013
New Revision: 1436364

URL: http://svn.apache.org/viewvc?rev=1436364&view=rev
Log:
fixing "marked" and "expanded" when using "next" or "previous" navigation buttons

Modified:
    myfaces/tobago/branches/tobago-1.5.x/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/NavigationState.java

Modified: myfaces/tobago/branches/tobago-1.5.x/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/NavigationState.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-1.5.x/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/NavigationState.java?rev=1436364&r1=1436363&r2=1436364&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-1.5.x/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/NavigationState.java (original)
+++ myfaces/tobago/branches/tobago-1.5.x/tobago-example/tobago-example-demo/src/main/java/org/apache/myfaces/tobago/example/demo/NavigationState.java Mon Jan 21 14:23:33 2013
@@ -50,8 +50,13 @@ public class NavigationState implements 
   }
 
   private void initState() {
-//    state.getMarkedState().setMarked(currentNode.getTreePath());
-//    state.getExpandedState().expand(currentNode.getTreePath());
+    // set marked
+    currentNode.setMarked(true);
+
+    // set expanded
+    for (NavigationNode parent = currentNode; parent != null; parent = (NavigationNode) parent.getParent()) {
+      parent.setExpanded(true);
+    }
   }
 
   public NavigationNode getCurrentNode() {
@@ -120,8 +125,4 @@ public class NavigationState implements 
     final NavigationNode nextNode = currentNode.getNextNode();
     return nextNode == null;
   }
-
-//  public TreeState getState() {
-//    return state;
-//  }
 }