[Wicket-user] Re: How can i get tree node detail and show in another panel

2005-11-02 Thread Alex Chew
I got the console output: 09:53:35,497 INFO [STDOUT] wicket.WicketRuntimeException: Cannot replace a component which has not been added: id='detailMsg':[Page class = wicket.examples.navtree.ContentPage, id = 1]09:53:35,497 INFO [STDOUT] at

Re: [Wicket-user] Re: How can i get tree node detail and show in another panel

2005-11-02 Thread Igor Vaynberg
it is saying that you are trying to replace a component that hasnt been added yet. you have to add a component before you can replace it, otherwise you are replacing nothing. so in your code you need to do this: if (get(detailMsg)==null) { add(new label(detailMsg)) } else { replace(new

[Wicket-user] Re: How can i get tree node detail and show in another panel

2005-11-02 Thread Alex Chew
I tried wicket 1.1, with same code fragment, i got RunTimeException: wicket.WicketRuntimeException: The component(s) below failed to render: 1. [Component id = detailMsg, page = wicket.examples.navtree.ContentPage, path = 1:detailMsg.Label, isVisible = true, isVersioned = true] at

[Wicket-user] Re: How can i get tree node detail and show in another panel

2005-11-02 Thread Alex Chew
Thanks, Igor. It resolved. When replace a component, the path should be correct. For my application, the Label detailMsg is child of Border navomaticBorder, so thecode fragment must like this: Page p = this.getPage();Label newlabel = new Label(detailMsg, Replaced);p.replace(new

Re: [Wicket-user] Re: How can i get tree node detail and show in another panel

2005-11-02 Thread Igor Vaynberg
im not that familiar with the tree component, so maybe someone else can answer this. generally wicket components manage their own state, so when your page is refreshed the tree should look the same. -Igor On 11/2/05, Alex Chew [EMAIL PROTECTED] wrote: Thanks, Igor. It resolved. When replace a