Author: knopp
Date: Tue Jun 12 06:01:22 2007
New Revision: 546473

URL: http://svn.apache.org/viewvc?view=rev&rev=546473
Log:
called afterRender 

Modified:
    
incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/tree/AbstractTree.java

Modified: 
incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/tree/AbstractTree.java
URL: 
http://svn.apache.org/viewvc/incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/tree/AbstractTree.java?view=diff&rev=546473&r1=546472&r2=546473
==============================================================================
--- 
incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/tree/AbstractTree.java
 (original)
+++ 
incubator/wicket/trunk/jdk-1.4/wicket/src/main/java/org/apache/wicket/markup/html/tree/AbstractTree.java
 Tue Jun 12 06:01:22 2007
@@ -207,11 +207,18 @@
                                        {
                                                public void visitItem(TreeItem 
item)
                                                {
-                                                       item.beforeRender();
-                                                       // rewind markupStream
-                                                       
markupStream.setCurrentIndex(index);
-                                                       // render child
-                                                       
item.onRender(markupStream);
+                                                       try 
+                                                       {
+                                                               
item.beforeRender();
+                                                               // rewind 
markupStream
+                                                               
markupStream.setCurrentIndex(index);
+                                                               // render child
+                                                               
item.onRender(markupStream);
+                                                       } 
+                                                       finally 
+                                                       {
+                                                               
item.afterRender();
+                                                       }
                                                }
                                        });
                                        // children are rendered, clear the flag
@@ -524,6 +531,7 @@
        public void onDetach()
        {
                attached = false;
+               updateTreeCalled = false;
                super.onDetach();
        }
 
@@ -767,11 +775,15 @@
                }
        }
 
+       private transient boolean updateTreeCalled = false;
+       
        /**
         * Updates the changed portions of the tree using given 
AjaxRequestTarget.
         * Call this method if you modified the tree model during an ajax 
request
         * target and you want to partially update the component on page. Make 
sure
         * that the tree model has fired the proper listener functions.
+        * <p>
+        * <b>You can only call this method once in a request.</b>
         * 
         * @param target
         *            Ajax request target used to send the update to the page
@@ -783,6 +795,8 @@
                        return;
                }
 
+               updateTreeCalled = true;
+               
                // check whether the model hasn't changed
                checkModel();
 


Reply via email to