API / Apache Wicket Interview questions
What is the wicket:id attribute?
wicket:id is a plain HTML attribute Wicket looks for at render time to decide which Java component controls a given tag — it's the single mechanism that ties markup to code.
A tag like <span wicket:id="greeting">placeholder</span> in the HTML is matched against a component added in Java with add(new Label("greeting", "Hello!")); Wicket replaces the placeholder content with whatever the Label renders. Because it's just an attribute, the HTML file stays valid, previewable markup that a designer can open directly in a browser or WYSIWYG tool — the placeholder text shows up as-is until Wicket actually processes it.
The ID has to be unique among siblings under the same parent container, not globally unique across the whole page, since Wicket resolves it relative to whichever container component is currently being rendered.
More Related questions...