Sorry..I just remembered that it could be a problem with the userId value
(which I tried to pass to the first tab and show on a Label). THAT only
appears AFTER I click on the tab, and not when the TabbedPanel page loads..

Actually, if I add another Label with it's contents defined within the first
tab panel, it shows up.. :/ duuh

Nevertheless, I'd still like to know how to pass the userId argument from
the LoginPage to the first tab..if someone wants to take a look at the
previous post..or maybe I'll find out (my guess is that It's some kind of
Java-related mistake and not a Wicket one..  :)

PS: kind of newbie in wicket and haven't been programming much in Java :P

Thanks, Edd


eddmosphere wrote:
> 
> Hi there!
> 
> Maybe someone can help me: I have a Login page which sends me to another
> page that contains the TabbedPanel.
> 
> What I need is to show the contents of the first tab (as if it was the
> user Home page) when the TabbedPanel page loads..but that's not happening,
> because I couldn't find how to set that first tab as the "active" tab..I
> tried setSelectedTab(0) but it didn't work - I always need to select the
> tab before it's contents show. 
> 
> 
> Here's some code:____________________________________________________
> 
> 
> ---BasePage--  page that contains the TabbedPanel and is called by the
> LoginPage onSubmit()
>     
>     ...
>     public BasePage() {
>         setModel(new Model("tabpanel"));
>         List tabs = new ArrayList();
> 
>         tabs.add(new AbstractTab(new Model("Home")){
>             public Panel getPanel(String panelId){
>                 return new TabPanel1(panelId, userId); //userId is the
> TabPanel1 content (a Label)
>             }
>         });
>         tabs.add(new AbstractTab(new Model("Users")){
>             public Panel getPanel(String panelId){   
>                 return new TabPanel2(panelId);
>             }
>         });
>       
>       TabbedPanel tabbedPanel = new TabbedPanel("tabs", tabs);
>       tabbedPanel.setSelectedTab(0);
>       add(tabbedPanel);
>       ...
> 
> 
> 
> ---LoginPage----------------------
> 
> ...  
> if(authenticate...){
>       BasePage basePage = new BasePage();
>       basePage.setUserId(userIdIn); //value to pass to the TabPanel1 Label 
>       setResponsePage(basePage);
> }
> ...
> ____________________________________________________
> 
> Hope I explained well ._.
> 
> Thanks, Edd
> 

-- 
View this message in context: 
http://www.nabble.com/TabbedPanel---select-which-tab-to-show-when-page-loads-tf3765927.html#a10652961
Sent from the Wicket - User mailing list archive at Nabble.com.


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to