cancel
Showing results for 
Search instead for 
Did you mean: 

how to change tab on tabstrip via script

onkar_phadtare
Explorer
0 Kudos

we have a requirement that when we switch tabs, it should trigger specific script before loading up the tab. in current scenario we have taken a clickable area & placed on top of tab, and via that we are trying to perform the operation on script, tab is not switching via this script.

what tab strip method can be used here?

Accepted Solutions (1)

Accepted Solutions (1)

bwills
Contributor

Hi Onkar,

What I do is create a script and attach it to the onAfterRefresh event. Then at the beginning of the script I check to see what tab I'm on. If I'm on the tab that I want then I execute the script inside the if statement. Something like this:

// What is the currently selected tab?
var zseltab = session.findById("wnd[0]/usr/tabsTAB_GROUP_10").selectedTab.text;
session.utils.log('selected tab => ' + zseltab);

if(zseltab == 'tab name')
{
	// Put your script you want to execute here.
}

This is code I use on IW22.

Thanks,

Brian

Answers (0)