Otis Ottington
Otis Ottington

Reputation: 435

Markup id set on a component that is usually not rendered into markup

I am getting this message:

Markup id set on a component that is usually not rendered into markup. Markup id: pnlMessages3a, component id: pnlMessages, component tag: wicket:panel.

The panel is added to a enclosing panel like this:

add(new MessagePanel("pnlMessages"));

in html

<wicket:panel wicket:id="pnlMessages">tblData</wicket:panel>

Within the MessagePanel I am calling super(id) passing the component id "pnlMessages" to the parent class. There is no other component within the class MessagePanel that enables the OutputMarkupId.

So why do I get the warning?

I have to mention that some Labels and images are updated within the MessagePanel using AjaxSelfUpdatingTimerBehavior

Upvotes: 0

Views: 1735

Answers (1)

martin-g
martin-g

Reputation: 17513

The reason is that you misuse <wicket:panel>. Its purpose is to wrap the HTML content of MyPanel.html. I.e. Wicket will use the content <wicket:panel> CONTENT </wicket:panel> as markup that should be included into another panel or a page.

In addition any <wicket:xyz> element is not rendered by Wicket in production mode. So trying to update such HTML element with Ajax will fail because it won't be in the DOM.

You should replace it with: <div wicket:id="pnlMessages">tblData</div>

Upvotes: 2

Related Questions