FORUMS

c360 Forums
 Home        Members    Calendar    Who's On

Welcome Guest ( Login | Register )
      



Which TabBar tab was clicked or lost focus?Expand / Collapse
Message
Posted 8/24/2007 1:00:17 AMPost #1728
 

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie
I've set up my TabBar thus:

ITabBar objTabBar = ControlFactory.CreateTabBar();

objTabBar.ID = "objTabBar";

objTabBar.ClientSideAfterChangeHandler = "ChangeTab";

Now in ChangeTab() I want to discover which tab lost focus or was clicked.

Posted 8/28/2007 10:21:21 AMPost #1733
 

c360 Product Expertc360 Product Expertc360 Product Expertc360 Product Expertc360 Product Expertc360 Product Expertc360 Product Expertc360 Product Expert
On the client side you can use javascript to determine which tab is selected.
What you need to do is to check if the tabItem element on the page has the 'tabOn' string in the className attribute...(just love the IE Developer ToolBar...)

I have attached a slightly altered (old?) c360 exercise page which has some javascript that does so:

The code that shows is in the Change() javascript method that looks like this:

function Change()
{
var tabItem = document.getElementById("tab0");
var tabControl = document.getElementById("TabBar");
alert("Is North selected? " + IsC360TabBarItemSelected(tabItem));
var tabItems = getC360TabBarItems(tabControl)
for (i=0;i<tabItems.length;i++)
{
if (IsC360TabBarItemSelected(tabItems[i]))
alert(tabItems[i].title + " is selected.");
}
}


  Post Attachments 
SelectedTab.zip (111 views, 1.33 KB)
Posted 8/28/2007 10:48:30 AMPost #1734
 

c360 Product Expertc360 Product Expertc360 Product Expertc360 Product Expertc360 Product Expertc360 Product Expertc360 Product Expertc360 Product Expert
pklingens (8/28/2007)
On the client side you can use javascript to determine which tab is selected.
What you need to do is to check if a tabItem element on the page has the 'tabOn' string in the className attribute...(just love the IE Developer ToolBar...)

I have attached a slightly altered (old?) c360 exercise page which has some javascript that does so:
....

Oeps, just noticed the document.GetElementById("tab0") does not return the right tabItem element ...

Updated this in the attachment with this post.

In addition using the javascript posted in the attachment you can also select a tab doing:

var tabItem = getC360TabBarItemByCaption("TabBar", "North")
tabItem.click();



  Post Attachments 
SelectedTab.zip (108 views, 1.57 KB)
« Prev Topic | Next Topic »


Reading This TopicExpand / Collapse
Active Users: 0 (0 guests, 0 members, 0 anonymous members)
No members currently viewing this topic.
Forum Moderators: kanika.jackson, Ken Champion

PermissionsExpand / Collapse

All times are GMT -5:00, Time now is 4:56pm

Powered by InstantForum.NET v4.1.4 © 2008
Execution: 0.734. 17 queries. Compression Enabled.