Skip to content

Instantly share code, notes, and snippets.

@jmewes jmewes/wicket-layout.md
Last active Jun 1, 2019

Embed
What would you like to do?
Wicket page layout

Wicket as page layout manager

WebMarkupContainer

org.apache.wicket.markup.html.WebMarkupContainer

https://ci.apache.org/projects/wicket/guide/8.x/single.html#_creating_in_line_panels_with_webmarkupcontainer

"WebMarkupContainer is an inline container like"

  ...
  <span wicket:id="xxx">
    <span wicket:id="mylabel">My label</span>
    ....
  </span>
  ...
  • Base class, e.g. for Panel, Fragment, and Form

Panel

org.apache.wicket.markup.html.panel.Panel

https://ci.apache.org/projects/wicket/guide/8.x/single.html#_divide_et_impera

"a Panel has its own associated markup file and the container content is taken from that file, like:"

<!DOCTYPE html>
<html xmlns:wicket="http://wicket.apache.org" lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">

    <link href="../../css/style.css" rel="stylesheet">
</head>

<body>

<wicket:panel>

    <p>Panel contents</p>

</wicket:panel>

</body>

</html>

Fragment

org.apache.wicket.markup.html.panel.Fragment

  • conditionally display small fragments of markup in a page
  • markup defined in parent container (page or panel)

References

Inheritance

https://ci.apache.org/projects/wicket/guide/8.x/single.html#_markup_inheritance_with_the_wicket_extend_tag

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.