# Problem with Popup Window

**URL:** <https://forum.inductiveautomation.com/t/problem-with-popup-window/53017>\
**Category:** Ignition\
**Created:** [November 12, 2021, 1:44pm UTC](https://forum.inductiveautomation.com/t/problem-with-popup-window/53017 "2021-11-12T13:44:16Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![stefano.sforna](https://avatars.discourse-cdn.com/v4/letter/s/91b2a8/32.png) [@stefano.sforna](https://forum.inductiveautomation.com/u/stefano.sforna)\
**Post date:** [November 12, 2021, 1:44pm UTC](https://forum.inductiveautomation.com/t/problem-with-popup-window/53017/1 "2021-11-12T13:44:16Z")

</div>

Good afternoon,  
in my project, I add a second screen.  
When I open a popup in second screen, popup is visualize in main screen, not in second screen.

Why???

Thank You

---

<div class="post-metadata">

**Author:** ![bschroeder](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bschroeder/32/13260_2.png) [@bschroeder](https://forum.inductiveautomation.com/u/bschroeder)\
**Post date:** [November 12, 2021, 1:54pm UTC](https://forum.inductiveautomation.com/t/problem-with-popup-window/53017/2 "2021-11-12T13:54:26Z")

</div>

What version of Ignition?

---

<div class="post-metadata">

**Author:** ![stefano.sforna](https://avatars.discourse-cdn.com/v4/letter/s/91b2a8/32.png) [@stefano.sforna](https://forum.inductiveautomation.com/u/stefano.sforna)\
**Post date:** [November 12, 2021, 1:56pm UTC](https://forum.inductiveautomation.com/t/problem-with-popup-window/53017/3 "2021-11-12T13:56:47Z")

</div>

ignition \*8.1.5

---

<div class="post-metadata">

**Author:** ![bschroeder](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bschroeder/32/13260_2.png) [@bschroeder](https://forum.inductiveautomation.com/u/bschroeder)\
**Post date:** [November 12, 2021, 1:57pm UTC](https://forum.inductiveautomation.com/t/problem-with-popup-window/53017/4 "2021-11-12T13:57:36Z")

</div>

Can you post your code that you are using to open the popup? Use ``` before and after the code so that its formatted.

---

<div class="post-metadata">

**Author:** ![stefano.sforna](https://avatars.discourse-cdn.com/v4/letter/s/91b2a8/32.png) [@stefano.sforna](https://forum.inductiveautomation.com/u/stefano.sforna)\
**Post date:** [November 12, 2021, 2:01pm UTC](https://forum.inductiveautomation.com/t/problem-with-popup-window/53017/5 "2021-11-12T14:01:54Z")

</div>

"window = system.nav.openWindow(‘Popups/TempoComponentiReport’, {‘stringa’ : "DURATA “+ str(chartEntity.columnKey) + " (s) : " + str((end\_data - start\_data) / 1000)})  
system.nav.centerWindow(window)”

---

<div class="post-metadata">

**Author:** ![bschroeder](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bschroeder/32/13260_2.png) [@bschroeder](https://forum.inductiveautomation.com/u/bschroeder)\
**Post date:** [November 12, 2021, 2:09pm UTC](https://forum.inductiveautomation.com/t/problem-with-popup-window/53017/6 "2021-11-12T14:09:51Z")

</div>

So when you have a button on a second screen it shows up on the primary screen correct?

> [@stefano.sforna](#):
>
> ```auto
> window = system.nav.openWindow(‘Popups/TempoComponentiReport’, {‘stringa’ : "DURATA “+ str(chartEntity.columnKey) + " (s) : " + str((end_data - start_data) / 1000)})
> system.nav.centerWindow(window)
> 
> ```

If so you will need to grab the handle of the screen you are on first and get that desktop to be able to open the window.  
See [system.nav.desktop - Ignition User Manual 8.1 - Ignition Documentation](https://docs.inductiveautomation.com/display/DOC81/system.nav.desktop)

Try something like this:

```auto
thisDesktopHandle = system.gui.getCurrentDesktop() #Get the screen handle where this even occurred
thisNavDesktop = system.nav.desktop(thisDesktopHandle)

#Now open up the popup
window = thisNavDesktop.openWindow(‘Popups/TempoComponentiReport’, {‘stringa’ : "DURATA “+ str(chartEntity.columnKey) + " (s) : " + str((end_data - start_data) / 1000)})
system.nav.centerWindow(window)

```

---

<div class="post-metadata">

**Author:** ![stefano.sforna](https://avatars.discourse-cdn.com/v4/letter/s/91b2a8/32.png) [@stefano.sforna](https://forum.inductiveautomation.com/u/stefano.sforna)\
**Post date:** [November 12, 2021, 2:17pm UTC](https://forum.inductiveautomation.com/t/problem-with-popup-window/53017/7 "2021-11-12T14:17:06Z")

</div>

I try but not work.  
I have this problem when open a popup from another popup opened.

---

<div class="post-metadata">

**Author:** ![bschroeder](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bschroeder/32/13260_2.png) [@bschroeder](https://forum.inductiveautomation.com/u/bschroeder)\
**Post date:** [November 12, 2021, 2:19pm UTC](https://forum.inductiveautomation.com/t/problem-with-popup-window/53017/8 "2021-11-12T14:19:17Z")

</div>

So you open one popup on a screen and it opens correctly. And then when you try and open another popup from that popup it isn’t working?

Do you get any errors?

Can you add a print for thisDesktopHandle and make sure that this is reporting the correct desktop?

---

<div class="post-metadata">

**Author:** ![stefano.sforna](https://avatars.discourse-cdn.com/v4/letter/s/91b2a8/32.png) [@stefano.sforna](https://forum.inductiveautomation.com/u/stefano.sforna)\
**Post date:** [November 12, 2021, 2:38pm UTC](https://forum.inductiveautomation.com/t/problem-with-popup-window/53017/9 "2021-11-12T14:38:14Z")

</div>

When I open a PopUp from another popup in second screen, popup open in main screen, not in second screen

---

<div class="post-metadata">

**Author:** ![bschroeder](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bschroeder/32/13260_2.png) [@bschroeder](https://forum.inductiveautomation.com/u/bschroeder)\
**Post date:** [November 12, 2021, 2:39pm UTC](https://forum.inductiveautomation.com/t/problem-with-popup-window/53017/10 "2021-11-12T14:39:09Z")

</div>

OK any errors from the script I posted?  
Can you print out the value of thisDesktopHandle to see if that is the desktop you expect?

---

<div class="post-metadata">

**Author:** ![stefano.sforna](https://avatars.discourse-cdn.com/v4/letter/s/91b2a8/32.png) [@stefano.sforna](https://forum.inductiveautomation.com/u/stefano.sforna)\
**Post date:** [November 12, 2021, 3:08pm UTC](https://forum.inductiveautomation.com/t/problem-with-popup-window/53017/11 "2021-11-12T15:08:20Z")

</div>

thisDesktopHandle is always primary screen, also if I open popup in second screen

---

<div class="post-metadata">

**Author:** ![bschroeder](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bschroeder/32/13260_2.png) [@bschroeder](https://forum.inductiveautomation.com/u/bschroeder)\
**Post date:** [November 12, 2021, 3:11pm UTC](https://forum.inductiveautomation.com/t/problem-with-popup-window/53017/12 "2021-11-12T15:11:31Z")

</div>

Hmm… interesting. So you have created multiple desktops using system.gui.openDesktop() correct?

---

<div class="post-metadata">

**Author:** ![stefano.sforna](https://avatars.discourse-cdn.com/v4/letter/s/91b2a8/32.png) [@stefano.sforna](https://forum.inductiveautomation.com/u/stefano.sforna)\
**Post date:** [November 12, 2021, 3:17pm UTC](https://forum.inductiveautomation.com/t/problem-with-popup-window/53017/13 "2021-11-12T15:17:06Z")

</div>

“system.gui.openDesktop(  
screen= 1, # 2nd display  
width= 1920,  
height= 1080,  
windows= [“Main Windows/Silos1”,“Navigation”])”

This is code to create second desktop/screen

---

<div class="post-metadata">

**Author:** ![bschroeder](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bschroeder/32/13260_2.png) [@bschroeder](https://forum.inductiveautomation.com/u/bschroeder)\
**Post date:** [November 12, 2021, 3:32pm UTC](https://forum.inductiveautomation.com/t/problem-with-popup-window/53017/14 "2021-11-12T15:32:30Z")

</div>

OK give me a few minutes to poke around. I’ve done a bunch with multi-monitor so I’m sure I’ve done this.

---

<div class="post-metadata">

**Author:** ![bschroeder](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bschroeder/32/13260_2.png) [@bschroeder](https://forum.inductiveautomation.com/u/bschroeder)\
**Post date:** [November 12, 2021, 4:00pm UTC](https://forum.inductiveautomation.com/t/problem-with-popup-window/53017/15 "2021-11-12T16:00:40Z")

</div>

So I can’t reproduce this on 8.1.11.

the first popup on a secondary monitor I’m opening strictly with this:

```auto
window = system.nav.openWindow('CTD Popups/test1')
system.nav.centerWindow(window)

```

And on popup test1 I’ve got a button that opens another popup using

```auto
window = system.nav.openWindow('CTD Popups/test2')
system.nav.centerWindow(window)

```

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/1/2/12a17ba0039e53cf3b9c6350558568eb4027d285.png)

And they are opening up as expected. Maybe try upgrading Ignition to 8.1.11 and see if it is fixed.

---

<div class="post-metadata">

**Author:** ![stefano.sforna](https://avatars.discourse-cdn.com/v4/letter/s/91b2a8/32.png) [@stefano.sforna](https://forum.inductiveautomation.com/u/stefano.sforna)\
**Post date:** [November 12, 2021, 4:40pm UTC](https://forum.inductiveautomation.com/t/problem-with-popup-window/53017/16 "2021-11-12T16:40:37Z")

</div>

Ok, I try.  
Thank You
