This is what the link does in Wicket's source code:

new Link(linkId) {
           private static final long serialVersionUID = 1L;

           @Override
           public void onClick() {
               setSelectedTab(index);   // <-----
           }
       };


This is my code:
   /** Click on the Delete button */
   private void deleteBtnClick(AjaxRequestTarget target, Form<?> form) {
       TabbedPanel tabPanel = ((HomePage)getWebPage()).getTabbedPanel();
       tabPanel.setSelectedTab(0);      // <-------
   }

Wicket's code works, mine doesn't. I've tried with a button and an ajaxfallbacklink... Maybe I really should redirect to the same page with another parameter, like you did.



Martin Makundi wrote:
Nono... just look at the source code of the link.

**
Martin

2009/7/29 Gajo Csaba <[email protected]>:
I really hope that I don't have to write

?wicket:interface=:6:innertabs:tabs-container:tabs:0:link:8:ILinkListener::

into the code :(



Martin Makundi wrote:
Duh.. I am not sure but I guess you must create a mechanism... for
example ajax button opens page with such parameter that the tab
selects tab 0. You need to build that logic into tabbedpanel when it
is being rendered...

That's what we did. I am not sure if it is possible to call
setSelectedTab after the page has rendered... you could have a look at
the code in the tab link and do something similar.

**
Martin

2009/7/29 Gajo Csaba <[email protected]>:

Hello,

I've recently started working with Wicket, so a lot of things are still
unknown for me. For example, right now I have a tabbed panel with two
tabs.
In the begining, I write setSelectedTab(1), so that the first tab is the
default. This works ok.

However, I have an AjaxFallbackLink on the second tab. When I click on
it, I
want the following to happen:
tabbedPanel.setSelectedTab(0);

This creates an exception, saying that some components from tab #1 aren't
visble. And they shouldn't be, because I've selected tab #0.

If I click on the tab link manually (with a mouse), the tab opens fine.

What am I doing wrong? How can I select another tab through an ajax
fallback
link?

Thank you in advance,
Csaba



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


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



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to