see here for an example:
http://wicketstuff.org/wicket13/compref/?wicket:bookmarkablePage=%3Aorg.apache.wicket.examples.compref.TabbedPanelPage
-igor
On 10/30/07, DRE <[EMAIL PROTECTED]> wrote:
>
> Hoping someone can help me out here .... I've just started using Wicket and
> this is what I'm trying to do:
>
> I've got a main page that has a header, body, and footer where the body
> should be used as a wicket child. In the header I have a TabbedPanel. When
> I click on a tab I want the contents to appear in the body(not right below
> the tab....in the header.) It looks all pretty and the tabs work .... it's
> just that when I click on the tab I want "This is Tab #1" to be displayed in
> the body. I've tried using <wicket:extend> but to no avail. Thanks in
> advance .........
>
> Code:
>
> PanelPage.html
>
> <html>
> <head>
> <title wicket:id="title">Title goes here</title>
> <link rel="stylesheet" type="text/css" href="css/tab.css" />
> </head>
>
> <body>
>
> <div id="header">
> <div wicket:id="tabs" class="tabpanel">[tabbed panel will be
> here]</div>
> </div>
>
> <div id="body" class="body">
> This is the Body
> <wicket:child />
> </div>
>
> <div id="footer" class="footer">
> <br>
> </div>
>
> </body>
> </html>
>
>
>
> PanelPage.java
>
> public class PanelPage extends WebPage
> {
>
> public PanelPage()
> {
>
> final List tabs=new ArrayList();
>
> tabs.add(new AbstractTab(new Model("My Home Page"))
> {
> public Panel getPanel(String panelId)
> {
> return new TabPanel1(panelId);
> }
> });
>
> tabs.add(new AbstractTab(new Model("Leads"))
> {
> public Panel getPanel(String panelId)
> {
> return new TabPanel2(panelId);
> }
> });
>
>
> final TabbedPanel panel = new TabbedPanel("tabs", tabs);
> class TabTitleModel extends Model
> {
> public Object getObject(Component comp)
> {
> return ((ITab)
> tabs.get(panel.getSelectedTab())).getTitle().getObject(null);
> }
> }
> add(new Label("title", new TabTitleModel()));
> add(panel);
>
> add(new Label("footer", "This is in the footer"));
>
> }
>
>
> }
>
> TabbedPanel.html
>
> <wicket:panel>
> <div class="tab-row">
> <ul>
> <li wicket:id="tabs">
> <!-- The Tab link and display text -->
> # [[tab title]]
> </li>
> </ul>
> </div>
>
>
> <!-- Currently active panel falls here -->
>
> [panel]
>
> </wicket:panel>
>
>
> TabPanel1.html
>
> <html>
> <body>
> <wicket:panel>
> This is Tab #1
> </wicket:panel>
> </body>
> </html>
>
>
> TabPanel1.java
>
> package wicket.panel.panels;
>
> import wicket.markup.html.panel.Panel;
>
> public class TabPanel1 extends Panel
> {
> private static final long serialVersionUID = 1L;
>
> public TabPanel1(String id)
> {
> super(id);
> }
>
> }
> --
> View this message in context:
> http://www.nabble.com/TabbedPanel-tf4719265.html#a13491072
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]