On 10/31/07, Alexander Landsnes Keül <[EMAIL PROTECTED]> wrote:
>
> I have two questions regarding tabbed panels. I've read the example, so I've 
> been able to create a navigation with it but it's a bit limited.
>
> First thing, is it possible to nest tabbed panels? I tried to do so, but then 
> all the wickets in the panels stopped working. Way I set it up was create a 
> TabbedPanel where the different tabs referred to new TabbedPanels. Not really 
> sure if this is doable, but if so how would I go about it, and is it possible 
> to change the CSS style for the two tab panels?

yes it is possible, but i dont think it will help much returning a
tabbedpanel as the tab directly. instead return a panel that contains
a tabbedpanel inside. this is also how you would style the inner panel
differently, by wrapping it in a div tag with a class eg

<div class="tab1"><div wicket:id="tabs"/></div>

and style your panel like:

tab1 ul.first-tab {...} ....

>
> Second thing, I tried to make a helper class for adding tabs to a Tabbed 
> Panel. It works fine, except for the getPanel() overloading. I tried to do it 
> as follows:
>
>         public void addTab( final String label, final Panel tabPanel ) {
>                 tabs.add( new AbstractTab( new Model( label ))
>                 {
>                         private static final long serialVersionUID = 1L;
>                         public Panel getPanel( String panelID )
>                         {
>                                 return tabpanel;
>                         }
>                 });
>         }
>
> Simply changing it to "return new PersondataPanel( panelID );" works, but 
> this would mean creating one addTab(..) for each possible panel. Is there an 
> elegant way of solving this?

what you are doing is creating panels for tabs eagerly during
construction time, which isnt the best way to go about it. the whole
idea of having getpanel abstract in abstracttab is that it gives you
the hint that panels should be created lazily inside the callback.

-igor



>
>
>
> ---------------------------------------------------------------------
> 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]

Reply via email to