Default to Different Tab in Tab Container If Button Is Clicked

Hi – I am trying to use the Tab Switcher widget from the app store to default my tab container to open to a different active tab if a certain button is clicked. I’m not sure my use case will work for Tab Switcher so am seeking advice from anyone who can find a way to accomplish this: On my home page, I have a button that opens to the page containing my tab container. Upon clicking this particular button, I need the tab container to default to a different active tab. The catch is, the page containing my tab container is also opened by other buttons in my app, so I only want the Tab Switcher to trigger when I click a particular button that opens up the page. Any advice? Stated another way: I have button “A” and button “B” that both open up to my tab container page I only want to change the default tab if I click on button “B” Is my only workaround to create a separate page for button “B” and not share the page with button “A”?
2 answers

Hi SL,

There are two Tab Switcher widgets. One of them, I created: 

and for that one I can give you advice. The way to implement it for the scenario you depict is, that you need a context entity on the page button A directs to and that context entity should have an integer attribute.

When you click on button A, the integer attribute should be set to the tab pane you want to have opened on the tab container of your next page. This widget will read this attribute value -if instructed this way in the widget settings- and open the tab pane with the index corresponding with this attribute value.

For the negative scenario, just don’t set, or reset, this attribute to your default, when clicking on that button. 



Thanks, will try that. What does one put in “Tab Class” using the tab switcher? Wasn’t sure what to put there. I.e., if my tab container has no CSS class that it needs, can I put any string there?