A mean remove a tab fom the model. Take a look at this code:
public class HomePage extends WebPage
{
final List tabs = new ArrayList();
public HomePage(final PageParameters parameters)
{
tabs.add(new AbstractTab(new Model("tab 1"))
{
@Override
public Panel getPanel(String panelId)
{
return new EmptyPanel(panelId);
}
});
tabs.add(new AbstractTab(new Model("tab 2"))
{
@Override
public Panel getPanel(String panelId)
{
return new EmptyPanel(panelId);
}
});
TabbedPanel tp = new TabbedPanel("tp", tabs);
add(tp);
add(new Link("remove")
{
@Override
public void onClick()
{
tabs.remove(0);
}
});
}
@Override
protected void onRender(MarkupStream markupStream)
{
tabs.remove(0);
super.onRender(markupStream);
}
}
this line :
tabs.remove(0);
will throw an exception if was called from onRender method, and will not if
was called from onClick. The diferrence is that the onClick will to be
executed before the render phase
On Fri, Sep 25, 2009 at 11:41 AM, Jens Zastrow <[email protected]> wrote:
> Did you mean the the tab from the TabbedPanel or the whole TabbedPane from
> my page?
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>
--
Pedro Henrique Oliveira dos Santos