# TabStrip not always changing main screen when clicked

**URL:** <https://forum.inductiveautomation.com/t/tabstrip-not-always-changing-main-screen-when-clicked/41021>\
**Category:** Ignition\
**Tags:** ignition80, vision\
**Created:** [November 27, 2020, 6:55pm UTC](https://forum.inductiveautomation.com/t/tabstrip-not-always-changing-main-screen-when-clicked/41021 "2020-11-27T18:55:49Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![mark.sluser](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mark.sluser/32/19753_2.png) [@mark.sluser](https://forum.inductiveautomation.com/u/mark.sluser)\
**Post date:** [November 27, 2020, 6:55pm UTC](https://forum.inductiveautomation.com/t/tabstrip-not-always-changing-main-screen-when-clicked/41021/1 "2020-11-27T18:55:49Z")

</div>

Our system has a TabStrip component in a left window that updates the main display when an tabitem is clicked. However, intermittently after pressing a tabitem, the tab item will not update the display even though it shows that the clicked tabitem was selected.

Our tabstrip component uses cell update for all color values (background/foreground, unselected/selected/hover) from client tags

There is only 1 main (floating) window configured to startup.  
There are 3 docking windows configured to startup.

Our system is Windows 10, Ignition 8.1.0, 16GB Ram  
This behaviour was observed on Vision Clients running on Windows 10 and MacOS 10.15.7.

Any ideas on what is causing this bad behaviour?

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [November 28, 2020, 10:08am UTC](https://forum.inductiveautomation.com/t/tabstrip-not-always-changing-main-screen-when-clicked/41021/2 "2020-11-28T10:08:42Z")

</div>

I’ve seen this when I’ve accidentally set my nav to open instead of swap. When it happens, try using ctrl+tab to cycle between open windows and see if there are any more open that shouldn’t be

---

<div class="post-metadata">

**Author:** ![mark.sluser](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mark.sluser/32/19753_2.png) [@mark.sluser](https://forum.inductiveautomation.com/u/mark.sluser)\
**Post date:** [November 29, 2020, 1:29am UTC](https://forum.inductiveautomation.com/t/tabstrip-not-always-changing-main-screen-when-clicked/41021/3 "2020-11-29T01:29:21Z")

</div>

I had a look at the tabstrip and it is set to "SWAP’. The problem persists.  
See below:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/0/f/0f48b3cc82f4a42b344a82c4918b75bf25f5a638.png)

Any other ideas?

Thank you,

-Mark

---

<div class="post-metadata">

**Author:** ![mark.sluser](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mark.sluser/32/19753_2.png) [@mark.sluser](https://forum.inductiveautomation.com/u/mark.sluser)\
**Post date:** [November 29, 2020, 1:35am UTC](https://forum.inductiveautomation.com/t/tabstrip-not-always-changing-main-screen-when-clicked/41021/4 "2020-11-29T01:35:10Z")

</div>

For now the workaround is to click a different tab (2) from the tab you just clicked (1) and then click first tab (1) again.  
It is frustrating for the operators because sometimes it works the first time and sometimes it you need to do the workaround.

-Mark

---

<div class="post-metadata">

**Author:** ![rpavlicek](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/rpavlicek/32/55868_2.png) [@rpavlicek](https://forum.inductiveautomation.com/u/rpavlicek)\
**Post date:** [November 29, 2020, 2:52pm UTC](https://forum.inductiveautomation.com/t/tabstrip-not-always-changing-main-screen-when-clicked/41021/5 "2020-11-29T14:52:24Z")

</div>

You can try putting this code in the mouseEntered action on the root container of the docked window which contains the tab strip. It will put that window in focus as soon as the mouse pointer enters the that window and it’s contents to more gracefully be used:

```auto
window = str(system.gui.getParentWindow(event))
system.nav.openWindow(window)

```

This of course assumes a mouse is being used and not touch screen, otherwise we may have to try something else.

---

<div class="post-metadata">

**Author:** ![marshall.r](https://avatars.discourse-cdn.com/v4/letter/m/8e7dd6/32.png) [@marshall.r](https://forum.inductiveautomation.com/u/marshall.r)\
**Post date:** [March 26, 2021, 3:09pm UTC](https://forum.inductiveautomation.com/t/tabstrip-not-always-changing-main-screen-when-clicked/41021/6 "2021-03-26T15:09:27Z")

</div>

I’m having the same issue. Were you ever able to resolve other than to continue to use the work around?

---

<div class="post-metadata">

**Author:** ![mark.sluser](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mark.sluser/32/19753_2.png) [@mark.sluser](https://forum.inductiveautomation.com/u/mark.sluser)\
**Post date:** [April 18, 2021, 2:58pm UTC](https://forum.inductiveautomation.com/t/tabstrip-not-always-changing-main-screen-when-clicked/41021/7 "2021-04-18T14:58:22Z")

</div>

> [@rpavlicek](#):
>
> can try putting this code in the mouseEntered action on the root container of the docked window which contains the tab strip. It will put that window in focus as soon as the mouse pointer enters the that window and it’s contents to more gracefully be used:
> 
> ```auto
> 
> ```

I have tried using this code as suggested by @rpavlicek

```auto
window = str(system.gui.getParentWindow(event))
system.nav.openWindow(window)

```

However the problem still remains.

Any other suggestions?

This seems like a bug in my opinion.

-Mark

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [April 18, 2021, 9:49pm UTC](https://forum.inductiveautomation.com/t/tabstrip-not-always-changing-main-screen-when-clicked/41021/8 "2021-04-18T21:49:22Z")

</div>

It’s not working because you’re using openWindow instead of swapWindow. Main windows should be opened with swap, popups should be opened with open. Using open on main windows will open the new window on top of any others previously opened, and by default will only ever open one instance at a time. Therefore when you try to open one again, because it’s already opened, the function won’t do anything, including bringing it to the front.

---

<div class="post-metadata">

**Author:** ![mark.sluser](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mark.sluser/32/19753_2.png) [@mark.sluser](https://forum.inductiveautomation.com/u/mark.sluser)\
**Post date:** [April 18, 2021, 10:50pm UTC](https://forum.inductiveautomation.com/t/tabstrip-not-always-changing-main-screen-when-clicked/41021/9 "2021-04-18T22:50:31Z")

</div>

Umm. I have a docked window on the left with a tab strip. @rpavlicek suggested to put the code into the mouseEntered event handler action of the root container of the docked window and the intent of the code is to put the docked window into focus.

I believe he is suggesting the problem is due to the window losing its focus and so the first click puts the window in focus and subsequent click would then show the appropriate main window.

@rpavlicek code is to show the docked window, not the main window.

I believe the problem is not related to focus because subsequent clicks on the same tab does not show the appropriate main window.

My workaround is to click a different tab on the tab strip and then click back to the first tab to show the appropriate main window.

Make sense ?

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [April 19, 2021, 1:21am UTC](https://forum.inductiveautomation.com/t/tabstrip-not-always-changing-main-screen-when-clicked/41021/10 "2021-04-19T01:21:43Z")

</div>

Sorry, I just skimmed your reply. I still think the issue is calling openWindow somewhere.

You can check if more than one main window is open with a button somewhere that runs:

```auto
windows = system.gui.getOpenedWindowNames()
CSV = ','.join(windows)
system.gui.messageBox(CSV) 

```

When the issue occurs, run this and check if you have more than one main window opened

Also, using that script to openWindow will only make your problem worse, as you then have lots of main windows opened. OpenWindow also doesnt focus that window if it’s already opened behind another opened main window  
Each Windows opened with openWindow also starts its own navigation history, so you’ll also have no nav history either with Windows opened with openWindow

---

<div class="post-metadata">

**Author:** ![bmeyers](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bmeyers/32/37453_2.png) [@bmeyers](https://forum.inductiveautomation.com/u/bmeyers)\
**Post date:** [November 9, 2021, 8:51pm UTC](https://forum.inductiveautomation.com/t/tabstrip-not-always-changing-main-screen-when-clicked/41021/11 "2021-11-09T20:51:48Z")

</div>

I am 99% sure this is the correct solution.

User swaps to a new screen using tab strip.  
User then uses a button to open a new screen.  
User tries to swap back to previous screen using tab strip.  
Tab strip correctly says it swapped back to previous screen but that isn’t what the user sees; the user sees the opened screen from using the button.

Anyways, I used this script successfully to identify where I was opening screens instead of swapping to them. No more tab strip problems.

---

<div class="post-metadata">

**Author:** ![mark.sluser](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mark.sluser/32/19753_2.png) [@mark.sluser](https://forum.inductiveautomation.com/u/mark.sluser)\
**Post date:** [November 9, 2021, 9:46pm UTC](https://forum.inductiveautomation.com/t/tabstrip-not-always-changing-main-screen-when-clicked/41021/12 "2021-11-09T21:46:40Z")

</div>

Thank you @bmyers I will give that a try and let you know the results.

---

<div class="post-metadata">

**Author:** ![bmyers](https://avatars.discourse-cdn.com/v4/letter/b/ccd318/32.png) [@bmyers](https://forum.inductiveautomation.com/u/bmyers)\
**Post date:** [November 10, 2021, 4:44pm UTC](https://forum.inductiveautomation.com/t/tabstrip-not-always-changing-main-screen-when-clicked/41021/13 "2021-11-10T16:44:31Z")

</div>

Mark,  
I think you meant to give thanks to @bmeyers. Credit where it is due 🙂
