I have a Wicket panel that is attached to a Page. I need to obtain rendered HTML code that the panel generates. I need the same HTML that the panel generates to output that was sent to the browser. I don't what the HTML from the whole page.
My panel is a read-only so it doesn't matter if the output is re-generated.
private MyPanel myPanel;
public void onIntialize() {
super.onInitialize();
add(myPanel = new MyPanel());
}
new AjaxLink() {
public void onClick(AjaxRequestTarget target) {
String myPanelHtml = // obtain html somehow from myPanel
// do stuff with myPanelHtml
}
}
Are things different if I need rendered HTML from a component that is not a panel? A component that does not provide the markup.