Hi, all I design a component for display a navigation bar with panel swap tech. I define a Panel as the name of currentPanel and use DashboardPanel to instance it., and define a List<Panel> to generate the navigation bar. Other people will transfer the list to my component, and when the Link be clicked, my component will execute these codes:
currentPanel.replaceWith(targetPanel); currentPanel = targetPanel; but I get the following error message: WicketMessage: Method onLinkClicked of interface org.apache.wicket.markup.html.link.ILinkListener targeted at component [MarkupContainer [Component id = url]] threw an exception Root cause: java.lang.IllegalStateException: This method can only be called on a component that has already been added to its parent. I debug the application and I find there is a parent field in the currentPanel, in the begining, the value of parent field is "Panel", but parent field of targetPanel from the List<Panel> which is transfered from other application is NULL. I am confused on the parent field, who can tell me which part I forget to use the panel swapping tech? -- Many thanks! Haulyn Microproduction Mobile: +086-15864011231 email: [email protected], [email protected] website: http://haulynjason.net gtalk: [email protected] skype: saharabear QQ: 378606292 Haulyn Jason
