Skip to content

Instantly share code, notes, and snippets.

@jmewes
Last active June 1, 2019 13:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jmewes/fb06b2a8bc6b1f2dddbc2a8e1996fe8c to your computer and use it in GitHub Desktop.
Save jmewes/fb06b2a8bc6b1f2dddbc2a8e1996fe8c to your computer and use it in GitHub Desktop.
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