API / Apache Wicket Interview questions
Explain the execution flow of an AjaxLink click in Wicket?
An AjaxLink looks like a normal link in the markup, but clicking it triggers a JavaScript-driven asynchronous request instead of a full page navigation, and Wicket updates only the parts of the DOM the handler explicitly targets.
The link's markup carries JavaScript (added automatically by Wicket) that fires an XMLHttpRequest to the component's callback URL instead of following a normal href. On the server, the same page instance and event-handling machinery used for a regular click runs onClick(AjaxRequestTarget target), but instead of the framework re-rendering the whole page, the handler explicitly calls target.add(component) for whichever components changed.
Only those components get re-rendered into a partial response, which Wicket's client-side JavaScript then swaps into the existing DOM — the rest of the page, including any client-side JavaScript state like scroll position or a media player that's playing, is left completely untouched, which is the core reason AJAX components feel faster and less disruptive than a full page reload.
More Related questions...