Xpages - Tabbed Panels and URL's

I am looking for a way to open a tab other than the default tab on an Xpage via a URL - I cannot find a URL command that allow you to direct the browser to anything other than the default tab.

Anybody have any ideas on this?

Subject: A couple of workarounds

Default tab can be computed, so would it suit your purposes to have this based on an applicationScope or sessionScope variable, which you could set?

Alternatively, I notice from the HTML source that the style assigned to the li tag is either xspUnselectedTab or lotusSelected. Could you set that style with javascript?

Paul

Subject: Not in this case

I am looking at linking directly to specific tabs from external web sites, so I really need to be able to specify this in the URL. I’m not a web/java programmer and not to sure how to pass or handle parameters to xpages yet. I had thought that there would be a URL command available to create the link seeing as the tabs are all given names - looking at the generated html the tabs are all given anchors with href # which is of no use

Subject: context.getUrlParameter() is your friend

Okay, if you add a parameter to your URL, you will be able to extract it and set the default tab.

So you url will be “http://host/dbpath/xpage.xsp?tab=tabName

You can then use context.getUrlParameter(“tab”) to get whatever you’re passing as the default tab.

So go to the Tabbed Panel and you get the option to set ‘Tab opened by default’. Compute this to return the tab name (click on each tab and this is the value set in the Name field, by default tabPanel1, tabPanel2 etc.)

So your code to compute the tab will be something along these lines:

var selectedTab = context.getUrlParameter(“tab”);

if (selectedTab == “”) {

“tabPanel1”

} else {

selectedTab

}

Coincidentally I needed to set the default tab programmatically yesterday, and computing this value works quite nicely.

Regards

Paul

Subject: Thanks Paul

Worked a treat, even with my little knowledge!Still, I would have thought there was a way of setting this through a URL command.