Every panel must have a unique ID.
Each panel has a Placement that determines where it will appear, a weight for determining where it appears in relation to other panels with the same placement and a path to JSP / HTML fragment to include.
Before the panel is rendered, {@link #isAvailable(HttpServletRequest,HttpServletResponse,String)}is called to determine if the panel should be shown in the current context.
Panel
class is a helper class for a graphical component that consists of an outer frame and the content where the drawing is done.Panel
is the simplest container class. A panel provides space in which an application can attach any other component, including other panels. The default layout manager for a panel is the FlowLayout
layout manager.
@version 1.37, 04/07/06
@author Sami Shaio
@see java.awt.FlowLayout
@since JDK1.0
$panel
The Panel template would then be merged with the Panel model and rendered in the page as: Time time is now Sun Mar 15 07:32:51 EST 2009
heading=Welcome content=Welcome to MyCorp<p/>MyCorp is your telecommuting office portal. Its just like being there at the office!Then we create the /panel/simple-panel.htm that references the localized Page properties. Since a Page properties are made available through the $messages map, the Panel can access the Page properties using the variables $messages.header and $messages.content:
<fieldset> <legend class="title"> $messages.heading </legend> $messages.content </fieldset>In our page class, SimplePageDemo, we create and add the Panel instance:
public class SimplePanelDemo extends Page { public Panel panel = new Panel("panel", "/panel/simple-panel.htm"); }In the Page above we make use of Click's autobinding feature by declaring a public Panel field. Autobinding will automatically add the Panel to the Page model. The SimplePanelDemo template, /simple-panel-demo.htm, would reference the panel control:
$panel
And the result is: $form
Next up is the CustomerPanel: public class CustomerPanel extends Panel { private Form form = new Form("form"); public CustomerPanel(String name) { super(name); // We explicitly set the customer panel template setTemplate("/panel/customer-panel.htm"); form.add(new TextField("name"); form.add(new DateField("dateJoined"); form.add(new DoubleField("holdings"); } }The Border Panel template, /panel/border-panel.htm, will draw a Border around its contents:
<div> style="border: 1px solid black"> $panel </div>
Lastly we specify the NestedDemo Page, that creates a Border Panel, and adds CustomerPanel as a child. public class NestedDemo extends Page { private Panel borderPanel = new Panel("borderPanel", "/panel/border-panel.htm"); private CustomerPanel customerPanel = new CustomerPanel("panel"); public void onInit() { // Add CustomerPanel to the Border panel parentPanel.add(childPanel); // Add border panel to page addControl(parentPanel); } }The Page template, /nested-demo.htm, would reference the $borderPanel variable:
$borderPanel
Whereas WebMarkupContainer is an inline container like
... <span wicket:id="xxx"> <span wicket:id="mylabel">My label</span> .... </span> ...a Panel has its own associated markup file and the container content is taken from that file, like:
<span wicket:id="mypanel"/> TestPanel.html <wicket:panel> <span wicket:id="mylabel">My label</span> .... </wicket:panel>@author Jonathan Locke @author Juergen Donnerstag
Events:
onMove, onOpen, onZIndex, onMaximize, onMinimize, and onClose.
Default {@link #getZclass}: z-panel. @author jumperchen @since 3.5.0
|
|
|
|
|
|
|
|
|
|
|
|
|
|