|
From: Jaap de W. <ja...@de...> - 2006-09-22 21:17:07
|
Hello,
I want to do an action when a tab is selected.
(Actually I want to fill a tab with values from a httpRequest(), but
thats not the issue).
But I can find no way to find the selected tab.
According to the documentation I should use the |*getPosition
<cid:par...@de...>*() of the tabpane, but that
returns 'undefined'.
I tried to find the selected tab in the onmouseup ||of the tabpane
||(and in the onmousedown), using the code below, but that always gave
me as a result the page that was selected before (So when I first select
tab1, and then tab2, tab1 is updated when tab2 is selected.
I also tried the onselect of the tab, but that does not work before you
actually click in the tab area.
Has anyone suggestions?
Jaap
------ code used to find tab item from tabpane -------
function selectMenu(me)
{
var children = me.getChildNodes();
for (var i=0; i < children.getLength(); i++)
{
if (children.item(i).outerNode.className ==
'com_htmli_ui_Tab__selected')
{
var id = children.item(i).outerNode.id;
debug(id);
// only interested in id starting with Page
if (id.substr(0,4) == 'Page')
{
|| // find the corresponding node
|| var node = document.getElementById('Div'+ id);
if (node.innerHTML == '')
{
// do something
}
}
}
}
}
|
|