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

  • Problem
    A hidden panel section does not return after AJAX toggle.
    Cause
    No placeholder anchor is kept for hidden state rerender.
    Solution
    Enable placeholder output for panel elements that can be shown/hidden dynamically.
  • Problem
    Submit/validation becomes erratic after splitting UI into panels.
    Cause
    Form boundaries accidentally become nested and violate HTML behavior expectations.
    Solution
    Keep forms flat and use panel/fragment composition only for presentation boundaries.