Please send a test case, I'll look at it. your code seems to be fine, 
it's nothing illegal, it can be bug in tree.

Would you mind testing svn version first, it _might_ be already fixed.

Thanks,

-Matej

Karl M. Davis wrote:
> Matej,
>  
> I'm getting an ArrayIndexOutOfBounds when I go to select a tree node 
> right after it has been inserted into the tree when I 
> call Tree.updateTree(target); (my tree model is firing the correct 
> events).  If you'd like, I can get you a test case for this in a day or 
> two, but I just wanted to make sure I wasn't trying to do something I 
> can't first.
>  
> *Dummy Code:*
> myTreeModel.insertNewNode(parentNode, newNode);
> myTree.getTreeState().selectNode(newNode, true);
> if(target != null)
>     myTree.updateTree(target);
>  
> *Dump:*
> 00:25:18.609 ERROR! [SocketListener0-1] 
> wicket.RequestCycle.step(RequestCycle.java:1009) >20> -2
> java.lang.ArrayIndexOutOfBoundsException: -2
>  at java.util.ArrayList.get(ArrayList.java:323)
>  at 
> wicket.extensions.markup.html.tree.AbstractTree.updateTree(AbstractTree.java:753)
>  at 
> simplepersistence.feature.dynamicPages.PageEditorPanel$SaveButton.onSubmit(PageEditorPanel.java:240)
>  at 
> wicket.ajax.markup.html.form.AjaxSubmitButton$1.onSubmit(AjaxSubmitButton.java:60)
>  at 
> wicket.ajax.form.AjaxFormSubmitBehavior.onEvent(AjaxFormSubmitBehavior.java:92)
>  at wicket.ajax.AjaxEventBehavior.respond(AjaxEventBehavior.java:167)
>  at 
> wicket.ajax.AbstractDefaultAjaxBehavior.onRequest(AbstractDefaultAjaxBehavior.java:236)
>  at 
> wicket.request.target.component.listener.BehaviorRequestTarget.processEvents(BehaviorRequestTarget.java:98)
>  at 
> wicket.request.compound.DefaultEventProcessorStrategy.processEvents(DefaultEventProcessorStrategy.java:65)
>  at 
> wicket.request.compound.AbstractCompoundRequestCycleProcessor.processEvents(AbstractCompoundRequestCycleProcessor.java:57)
>  at wicket.RequestCycle.doProcessEventsAndRespond(RequestCycle.java:862)
>  at wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:900)
>  at wicket.RequestCycle.step(RequestCycle.java:976)
>  at wicket.RequestCycle.steps(RequestCycle.java:1050)
>  at wicket.RequestCycle.request(RequestCycle.java:454)
>  at wicket.protocol.http.WicketServlet.doGet(WicketServlet.java:217)
>  at wicket.protocol.http.WicketServlet.doPost(WicketServlet.java:260)
>  at javax.servlet.http.HttpServlet.service(HttpServlet.java:616)
>  at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
>  at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:428)
>  at 
> org.mortbay.jetty.servlet.WebApplicationHandler.dispatch(WebApplicationHandler.java:473)
>  at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:568)
>  at org.mortbay.http.HttpContext.handle(HttpContext.java:1530)
>  at 
> org.mortbay.jetty.servlet.WebApplicationContext.handle(WebApplicationContext.java:633)
>  at org.mortbay.http.HttpContext.handle(HttpContext.java:1482)
>  at org.mortbay.http.HttpServer.service(HttpServer.java:909)
>  at org.mortbay.http.HttpConnection.service(HttpConnection.java:820)
>  at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:986)
>  at org.mortbay.http.HttpConnection.handle(HttpConnection.java:837)
>  at 
> org.mortbay.http.SocketListener.handleConnection(SocketListener.java:245)
>  at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:357)
>  at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:534)
>  
> -- Karl
> 
> 
> ------------------------------------------------------------------------
> 
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share your
> opinions on IT & business topics through brief surveys -- and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Wicket-user mailing list
> Wicket-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wicket-user


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to