Select tab after microflow executes

1
 Hi, So, I'm facing the following problem: I have an application with two tabs (tab 1 and tab 2), tab 2 is hidden. Now the user wants that when it clicks in a button inside tab1, tab2 is showed and selected. I'm able to show tab2, but not select that tab. How can I select tab2 using Javascript?  I know that we can use Tab Switcher, but in this scenario if I implement the Tab Switcher solution, I will need to refactor some code, so I prefer not using it.  
asked
3 answers
4

Hi Jose, 

 

Just made a JavaScriptAction that may work for you:

export async function JS_TabContainerPageSwitch(tabContainerName, tabPageName) {
	// BEGIN USER CODE	
	dojo.query('.mx-name-'+tabContainerName).query('.mx-name-'+tabPageName)[0].click()
	// END USER CODE
}

 

All you have todo is provide the containerName and pageName and voilat.

 

 

 

 

Hope its helps

 

Best regards

answered
0

Add class ‘active’ to tab2. And remove it from tab1.

This is what you will see upon inspecting the tabs on a webpage:

 

answered
0

Hi Jose,

 

You could also duplicate the whole tab container below and make below duplicate container tab2 as active. Create a boolean to handle visibility for both the tab containers. When you press the button switch the boolean to make it true to see the below tab container with Tab2 as active and other one false to hide.

 

I also agree with above solution to add javascript, just a thought without major changes.+

 

Ashok

answered