Mateusz Moroz
Mateusz Moroz

Reputation: 411

Apache-Wicket renders tag <wicket:panel> in page body

I'm working with the tutorial "Navomatic" from wicket page. I modified it, so it does not contain the "Border" tags. I want to do the "magic" with panels. But when I create the panel, wicket renders the tag in the page body.

My LeftPanel.java:

public class LeftPanel extends Panel {
    public LeftPanel(String id) {
        super(id);
    }
}

My markup to that class, LeftPanel.html:

<wicket:panel>
    <a href="#">Page A</a>
    <br />
    <a href="#">Page B</a>
    <br />
    <a href="#">Page C</a>
</wicket:panel>

Result is the following page:

enter image description here

I add the panel to body like:

add(new LeftPanel("navigationBorder"));

And in the markup:

<wicket:panel>
    <div wicket:id="navigationBorder">
        Left div
    </div>
    <div wicket:id="bodyBorder">
        Right div
    </div>
</wicket:panel>

What am I doing wrong?

Upvotes: 2

Views: 517

Answers (1)

daiscog
daiscog

Reputation: 12057

Wicket leaves the <wicket> elements in the generated source when in "development mode" to aid debugging. Try using deployment mode by adding the following in web.xml:

<context-param>
    <param-name>configuration</param-name>
    <param-value>deployment</param-value>
</context-param>

If you want to strip out the wicket elements even in development mode, you can call getMarkupSettings().setStripWicketTags(true) in the init method of your Application class.

More information can be found on the Wicket wiki.

Upvotes: 3

Related Questions