I've been searching for a solution to dynamically changing the selectedindex of a tabstrip using javacript and so far have been unsuccessful.
I figured i'd give it a bash myself but have been having some problems. I'm trying to chande the selected tab to enable me to focus a particular control, so far i've got this:
function focusControl(control)
{
var aControl = control;
while ((aControl.parentElement != null) && (aControl.parentElement.tagName != 'PageView'))
{
aControl = aControl.parentElement;
}
if ((aControl.parentElement != null) && (aControl.parentElement.tagName == 'PageView'))
{
var pageControl = aControl.parentElement;
var tabStrip = document.getElementById('_TabStrip');
for (var child in tabStrip.children)
{
if ((child.getAttribute("_type") == "tab") &&
(child.getAttribute("targetID") == pageControl.id))
{
child.fireEvent('onclick');
break;
}
}
}
control.focus();
}
the problem i'm having is that i just get a 'property or method not supported' error when it hits child.getAttribute. I can see in the source of the tabstrip that this is being assigned for the control so i don't understand why it's not supported.
Any ideas? Or anybody know a better way of achieving this?