---
title: "Issue with open tab group in titanium"  
description: "Issue with open tab group in titanium"  
author: "Anonymous User"  
published: 2014-11-24  
updated: 2014-11-25  
canonical: https://www.mindstick.com/forum/12687/issue-with-open-tab-group-in-titanium  
category: "javascript"  
tags: ["jquery"]  
reading_time: 2 minutes  

---

# Issue with open tab group in titanium

I have 4 [tabs](https://www.mindstick.com/articles/43918/how-to-design-table-using-bootstrap) in a tab group. The tab [transition](https://answers.mindstick.com/qa/94090/a-material-is-dimensionally-stable-at-room-temperature-if-its-glass-transition-temperature-tg-is) on [click](https://www.mindstick.com/articles/12423/social-login-magento-2-one-click-to-register-social) of tab names is [working fine](https://answers.mindstick.com/qa/95550/why-is-the-safari-browser-not-working-fine). But I need to open tab2 from tab3 on click of [button event](https://www.mindstick.com/forum/12660/button-event-handler-not-working) in tab3. How can I do that.

**[Sample](https://www.mindstick.com/news/2174/mars-mission-by-nasa-prepares-for-tests) [code](https://yourviews.mindstick.com/view/85458/alan-turing-the-mastermind-behind-cracking-the-enigma-code-during-world-war-ii),**

```
<Alloy><Tab id="one">    <Window class="container">        <Label>This is the Home View</Label>    </Window></Tab><Tab id="two">    <Window class="container">        <Label>This is the second View</Label>    </Window></Tab><Tab id="three">    <Window class="container">        <Button onClick="saveLang">Proceed</Button>    </Window></Tab> </Alloy>
```

**[Controller](https://www.mindstick.com/blog/273/passing-values-from-controller-to-view-in-asp-dot-net-mvc):**

```
function saveLang(){// How can we open only tab2 here// I tried open index, the loading time taking long and also it is opening tab1 But I need to open tab2 for this event}
```

## Replies

### Reply by Anonymous User

*I am not currently on my system , still few issues/comments which I can mention are :*

Firstly I doubt your tabs would not work properly as they are not enclosed in TabGroup.

So your view should be like :

```
<Alloy>  <TabGroup id="myTabGrp"> //Tabgroup Added    <Tab id="one">        <Window class="container">            <Label>This is the Home View</Label>        </Window>    </Tab>     <Tab id="two">        <Window class="container" id="winTwo">            <Label>This is the second View</Label>        </Window>    </Tab>     <Tab id="three">        <Window class="container">            <Button onClick="saveLang">Proceed</Button>        </Window>     </Tab>  </TabGroup></Alloy>
```

Now when saveLang method gets called in **controller** we can call setActiveTab method:

```
function saveLang() {  $.myTabGrp.setActiveTab($.two);}
```

**Edit :** For reloading/refreshing content of a window in Tab , add focus [event](https://www.mindstick.com/articles/167719/marquee-hire-benefits-of-event-lighting-hire-london) of window in your **controller**:

```
$.winTwo.addEventListener('focus',function(e) {     alert('focus');});
```

Hope it is helpful.


---

Original Source: https://www.mindstick.com/forum/12687/issue-with-open-tab-group-in-titanium

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
