Antonio, Here's one very simple example. BTW I assume you fixed the little import problem the latest wicket version introduced.
===============java code==================
import java.util.ArrayList;
import java.util.List;
import nl.topicus.prodconf.ui.web.HeaderContributor;
import nl.topicus.prodconf.ui.web.tree.DefinitionsTreePanel;
import nl.wehkamp.prodconf.ui.web.components.TabPanel;
import wicket.Component;
import wicket.PageParameters;
import wicket.markup.ComponentTagAttributeModifier;
import wicket.markup.html.HtmlPage;
import wicket.markup.html.list.ListItem;
import wicket.markup.html.list.ListView;
import wicket.markup.html.panel.FeedbackPanel;
import wicket.markup.html.panel.Panel;
import wicket.model.IModel;
import wicket.model.Model;
/**
*/
public class MainPage extends HtmlPage
{
/** panel with tabs. */
private TabPanel panel;
/**
* Construct.
* @param parameters
*/
public MainPage(PageParameters parameters)
{
this();
}
/**
* Construct.
*/
public MainPage()
{
panel = new TabPanel("mainPanel"); //make container
for tabs
Panel temp = new
nl.wehkamp.prodconf.ui.web.main.customer.CustomerPanel("tab"); //verry
important every component you add must be named "tab" (without
quotes)!!!
panel.addTab("Klant", temp); //add component as tab
panel.addTab("Onderhoud", new
DefinitionsTreePanel("tab"));
//and yet another tab, notice the component is also
named "tab"
// both tab components are just wicket Panels.
add(panel);
}
}
=============html code================
<html>
<head>
</head>
<body>
<div id="wicket-mainPanel" />
</body>
</html>
================end of example code===============
95% of the time this is all you need.
But if you take a look in the TabPanel you see addTab allows you to add
Components rather then just Panels. So you can add Pages or Labels or
textFields. There's just one catch if you look into Tabpanel.html you
will see :" <div id="wicket-tab"/>" This is because for Panels you need
to use a div (it's a wicket thing). For Pages you need to use another
html element, maybe an Iframe will do the trick (haven't tried that) for
Labels you need to use <span> etc. So every tab you add must fit inside
the html element.
I hope this will help you out.
I use the following css btw:
==============css======================
#navigation
{
float:left;
width:100%;
background:#DAE0D2 url("images/bg_blue.gif") repeat-x bottom;
font-size:100%;
line-height:normal;
}
#navigation ul
{
margin:0;
padding:10px 10px 0;
list-style:none;
}
#navigation li
{
margin:0;
padding:0;
display: inline;
}
#navigation a
{
float:left;
background:url("images/left_both_blue.gif") no-repeat left top;
margin:0;
padding:0 0 0 9px;
border-bottom:1px solid #765;
text-decoration:none;
}
#navigation a span
{
float:left;
display:block;
background:url("images/right_both_blue.gif") no-repeat right
top;
padding:5px 15px 4px 6px;
color:#444444;
}
#navigation a span
{
float:none;
}
#navigation a:hover span
{
color:#333;
}
#navigation .selected
{
background-position:0 -150px;
border-width:0;
}
#navigation .selected span
{
background-position:100% -150px;
padding-bottom:5px;
color:#333;
}
#navigation a:hover
{
background-position:0% -150px;
}
#navigation a:hover span
{
background-position:100% -150px;
}
=============end of css==========
I attached the latest code.
Let me know if you run into any problems.
-----Oorspronkelijk bericht-----
Van: Antonio Casula [mailto:[EMAIL PROTECTED]
Verzonden: maandag 31 januari 2005 11:48
Aan: [email protected]
Onderwerp: RE: [Wicket-user] TabbedPanel ?
Hi Maurice,
seem interesting ... but , should you give us some
example how to use it , please? I have tryied but
TabPanel.html result missed.
Thanks a lot
Antonio
--- Maurice Marrink <[EMAIL PROTECTED]>
wrote:
> Here's one that I use.
>
>
>
>
>
>
>
>
>
>
>
> -----Oorspronkelijk bericht-----
> Van: Jonathan Carlson
> [mailto:[EMAIL PROTECTED]
> Verzonden: woensdag 26 januari 2005 0:10
> Aan: [email protected]
> Onderwerp: Re: [Wicket-user] TabbedPanel ?
>
>
>
> Navomatic seems rather static, but I'm sure it could
> be made more
> dynamic.
>
>
>
> I need something that would dynamically add
> links/tabs as you add
> TabPanes (for example), which would be panels
> themselves. I'd want the
> tabs to link back to the same page, just with a
> parameter that specifies
> which tab is active.
>
>
>
> In case you want more background of what I'm
> thinking... Picture a bean
> editing panel on the top of the page. Underneath
> that is a tab for each
> relationship of that bean. Some tabs will have a
> table of related beans
> (to-many relationship), others will just show the
> properties of one
> related bean (to-one relationship).
>
>
>
> - Jonathan (Carlson)
>
>
>
>
>
>
> >>> [EMAIL PROTECTED] 2005-01-25 11:48:02 AM >>>
>
> this functionality already exists!
>
> such a thing really shouldn't be required in wicket.
> panels are for
> holding reusable chunks of markup with components
> attached, like the
> sign in panel.
>
> what you want is simply to create a navigation like
> navomatic by simply
> putting a bunch of links on the page. what makes it
> a "tabbed" page is
> how the links look when they enable/disable as you
> use them.
>
> the "tabbiness" of the look should be a dreamweaver
> thing.
>
> what we really need is to somehow rename
> NavigationPanel in the examples
>
> (or remove it) because it is confusing and then
> create an example of how
>
> to do a tabbed look for a navigation using the
> "enabled" and "disabled"
> child for the link.
>
> a link is actually an HtmlContainer and can have
> children. there can
> optionally be two special children. one called
> "enabled" and one called
>
> "disabled". so to make a navigation, you simply
> make a bitmap image or
> chunk of HTML that renders an enabled tab (a link
> other than the
> selected link (that you can click on)) and call it
> "enabled" and another
>
> bitmap image or chunk of HTML that renders a
> disabled tab (the link to
> the current page (the one link you cannot click on))
> and call it
> "disabled".
>
> jon
>
> Jonathan Carlson wrote:
>
> > Has anyone started a TabbedPanel yet?
> >
> > Just Curious. I didn't see one but I'll need one
> eventually. If I
> > write it myself does anyone have suggestions on
> how to go about it
> > HTML-wise? I could just use a site like Amazon
> for example code. Or
> > maybe Tapestry has one I could convert over.
> >
> > - Jonathan
> >
> >
> >
>
**********************************************************************
> > This email and any files transmitted with it are
> confidential and
> > intended solely for the use of the individual or
> entity to whom they
> > are addressed. If you have received this email in
> error please notify
> > the system manager.
> >
> > www.katun.com <http://www.katun.com/>
> >
>
**********************************************************************
>
>
>
-------------------------------------------------------
> This SF.Net email is sponsored by: IntelliVIEW --
> Interactive Reporting
> Tool for open source databases. Create drag-&-drop
> reports. Save time
> by over 75%! Publish reports on the web. Export to
> DOC, XLS, RTF, etc.
> Download a FREE copy at
> http://www.intelliview.com/go/osdn_nl
> _______________________________________________
> Wicket-user mailing list
> [email protected]
>
https://lists.sourceforge.net/lists/listinfo/wicket-user
>
>
> ATTACHMENT part 2 application/octet-stream
name=TabPanel.java
> ATTACHMENT part 3 application/octet-stream
name=TabPanelModel.java
---------------------------------
__________________________________
Do you Yahoo!?
Yahoo! Mail - You care about security. So do we.
http://promotions.yahoo.com/new_mail
-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user
TabPanel.java
Description: TabPanel.java
TabPanelModel.java
Description: TabPanelModel.java
