Chapter 10: Panels and Rebirth - Give components lasting life
Panel
Panel is Wicket's primary reusable UI unit. It packages markup and behavior into one coherent module.
Fragment
Fragment lets you switch among markup variants at runtime while keeping logic centralized.
Border
Border wraps child content with common layout chrome such as headers, sidebars, or policy banners.
Composition
Prefer composing pages from reusable panels instead of copying markup and handler logic across pages.
Practical Pitfalls
-
ProblemA hidden panel section does not return after AJAX toggle.CauseNo placeholder anchor is kept for hidden state rerender.SolutionEnable placeholder output for panel elements that can be shown/hidden dynamically.
-
ProblemSubmit/validation becomes erratic after splitting UI into panels.CauseForm boundaries accidentally become nested and violate HTML behavior expectations.SolutionKeep forms flat and use panel/fragment composition only for presentation boundaries.