Hey everyone,
Has anyone found a way to wire a click event up to the tab image?
Thanks,
Pat
If anyone else out there is looking for a work around for this issue, this is the best I can do right now.
What I do is:
Trap the click event of the tabs on the client.
Check to see if the current tab clicked is the same as the current selected tab. If it is, I assume that they are clicking on the image in the selected tab.
function uwt_Main_Click(oWebTab, oTab, oEvent){
//Add code to handle your event here.
alert('in tab clicked event.');
var CurrentTab = oWebTab.getSelectedIndex();
alert('oWebTab Index ' + CurrentTab);
var newTabClicked = oTab.getIndex();
alert('oTab Index ' + newTabClicked);
if(CurrentTab == newTabClicked)
{
alert('the tab selected is the tab clicked');
}
If anyone has a better idea, please share it! I bet you could wire an event in the java script file controlling the tab control I just haven't looked into it.
Hi Pat,
If tabs contain images and you want to check if those images were clicked, then the easiest way is to check if source of event is IMG. Below is example:
function UltraWebTab1_Click(oWebTab, oTab, oEvent){ if(!oEvent.event) return; var src = oEvent.event.srcElement; if(!src) src = oEvent.event.target; if(!src) return; if(src.nodeName == 'IMG') alert('Mouse click on image of tab #' + oTab.getIndex());}