Sunday, March 11, 2012

Tabcontainer, Tabpanel and tabindex

Not sure what you mean... You can tab in each panel without any extra code, try the demo:http://www.asp.net/AJAX/Control-Toolkit/Live/Tabs/Tabs.aspx

-Damien


Ok, I give you an example.

Let's say I have a textbox and a button above my tabcontainer with a few tabs. When the page is loaded I can navigate through my controls with the tab button on my keybord. First the textbox is marked then the button. Thereafter my tabcontainer gets selected (becouse that is my tabindex order). This is when I want to navigate in my tabs with the keyboard, eaither with the tab or with the arrows.

Let's say I need to figure out how the tab support people only using a keyboard surfing the web.


Gotcha.

You could capture the arrow keys using JavaScript and then use this client-side approach:http://forums.asp.net/p/1071804/1723878.aspx

-Damien


Capture the arrow keys sounds great but I can't actually see how to use that and the javascript in the example you posted. Perhaps you could guide me a bit more?

I though that from the beginning, this control would have support for tabindex. But now I have ended up writing lot's of code. Perhaps stuff like this is fixed in future releases :-)


You need a client-side function that handles keypresses, for example:http://www.geekpedia.com/tutorial138_Get-key-press-event-using-JavaScript.html orhttp://www.faqts.com/knowledge_base/view.phtml/aid/1760

Then you can use the JavaScript function in that post to get the current tab (I believe it is get_activeTab()) and set the new tab index (described in the post).

Hope this helps

-Damien


Bit more information:

You can useget_activeTabIndex() to retrieve the current index and use get_tabs().length to determine the number of tabs.

-Damien

No comments:

Post a Comment