I have this html markup:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.apache.org/" xml:lang="cs" lang="cs">
<wicket:panel>
<div id="nav">
<ul>
<li>
<a href="./page2.html" class="here">page 1</a>
</li>
<li>
<a href="./page3.html" class="">page 2</a>
</li>
<li>
<a href="./kontakt.html" class="">page 3</a>
</li>
</ul>
</div>
</wicket:panel>
</html>
and this is my very simple wicket code for panel:
public class PanelMenu extends Panel{
private static final long serialVersionUID = 1L;
public PanelMenu(String id){
super(id);
}
}
@Override
protected void onBeforeRender(){
String markup = this.getAssociatedMarkup().toString();
markup = markup.replaceAll("a", "b");
//how to write modyfied markup for panel to response?
this.getResponse().write(markup);//this write to start of the page, not panel
super.onBeforeRender();
}
On my page I do:
this.add((new PanelMenu("panelMenu")).setRenderBodyOnly(true));
I need to know how to write modyfied html markup for panel in variable markup back into response. How can I do it? this.getResponse().write(markup) write at the start of the page.