# Form in dialog popped on a second monitor

**URL:** <https://forum.servoy.com/t/form-in-dialog-popped-on-a-second-monitor/11909>\
**Category:** Classic Servoy\
**Created:** [March 12, 2010, 2:01pm UTC](https://forum.servoy.com/t/form-in-dialog-popped-on-a-second-monitor/11909 "2010-03-12T14:01:17Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![diana.bodnarescu](https://avatars.discourse-cdn.com/v4/letter/d/a88e57/32.png) [@diana.bodnarescu](https://forum.servoy.com/u/diana.bodnarescu)\
**Post date:** [March 12, 2010, 2:01pm UTC](https://forum.servoy.com/t/form-in-dialog-popped-on-a-second-monitor/11909/1 "2010-03-12T14:01:17Z")

</div>

Hello,

I am using Servoy 3.5.10 i4-build 524 and I am popping a non-modal form in dialog. When closing the form in dialog, i store it’s current location (x1 and y1) and the next time this form in dialog is popped i give the stored values (x1 and y1) as parameters for the location, so that it is displayed in the exact location it was closed from.  
The location is properly displayed unless i use 2 monitors and store the location of the form in dialog when it is on the second monitor. If the location stored does not exist on the 1st monitor (because of the resolution), it displays it correctly on the second monitor. I see that if the form in dialog was on the second monitor, but on a location that exists in the first monitor as well, it will display it on the first monitor…  
Is there a way i that i can display the form in a given location,but on a second monitor?

Thank you,  
Diana

---

<div class="post-metadata">

**Author:** ![Harjo](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/harjo/32/4873_2.png) [@Harjo](https://forum.servoy.com/u/Harjo)\
**Post date:** [March 13, 2010, 1:01pm UTC](https://forum.servoy.com/t/form-in-dialog-popped-on-a-second-monitor/11909/2 "2010-03-13T13:01:39Z")

</div>

Why are you storing FID positions?

if you name them, Servoy does that already for you, automaticly

---

<div class="post-metadata">

**Author:** ![diana.bodnarescu](https://avatars.discourse-cdn.com/v4/letter/d/a88e57/32.png) [@diana.bodnarescu](https://forum.servoy.com/u/diana.bodnarescu)\
**Post date:** [March 13, 2010, 3:50pm UTC](https://forum.servoy.com/t/form-in-dialog-popped-on-a-second-monitor/11909/3 "2010-03-13T15:50:23Z")

</div>

Thank you for your answer Harjo,  
I need to store them because i want the last position to be displayed even if i close the client and open it later. Also I want this to be user specific.  
Diana

---

<div class="post-metadata">

**Author:** ![Andrei\_Costescu](https://avatars.discourse-cdn.com/v4/letter/a/e36b37/32.png) [@Andrei\_Costescu](https://forum.servoy.com/u/Andrei_Costescu)\
**Post date:** [March 15, 2010, 12:37pm UTC](https://forum.servoy.com/t/form-in-dialog-popped-on-a-second-monitor/11909/4 "2010-03-15T12:37:39Z")

</div>

> diana.bodnarescu:  
> The location is properly displayed unless i use 2 monitors and store the location of the form in dialog when it is on the second monitor. If the location stored does not exist on the 1st monitor (because of the resolution), it displays it correctly on the second monitor. I see that if the form in dialog was on the second monitor, but on a location that exists in the first monitor as well, it will display it on the first monitor…

Can this be reproduced using the built-in i18n dialog (“application.showI18NDialog()”)?  
It is intended to behave as you want your non-modal dialogs to behave - reopen at last location even if you restart the client.

---

<div class="post-metadata">

**Author:** ![diana.bodnarescu](https://avatars.discourse-cdn.com/v4/letter/d/a88e57/32.png) [@diana.bodnarescu](https://forum.servoy.com/u/diana.bodnarescu)\
**Post date:** [April 9, 2010, 12:52pm UTC](https://forum.servoy.com/t/form-in-dialog-popped-on-a-second-monitor/11909/5 "2010-04-09T12:52:40Z")

</div>

> Can this be reproduced using the built-in i18n dialog (“application.showI18NDialog()”)?  
> It is intended to behave as you want your non-modal dialogs to behave - reopen at last location even if you restart the client.

I tried to reproduce with the application.showI18NDialog() dialog, but this one only remembers the location if it is inside the 1st monitor. If I move the i18n dialog to the second monitor and close the dialog, the next time I open it,it will be displayed in the middle of the 1st monitor.  
Also the location is not memorized if i switch computers,nor if i use the same computer but clear java cache and .servoy folder.  
Also application.showI18NDialog() dialog is not user specific,it behaves the same for all users…

Diana

---

<div class="post-metadata">

**Author:** ![Andrei\_Costescu](https://avatars.discourse-cdn.com/v4/letter/a/e36b37/32.png) [@Andrei\_Costescu](https://forum.servoy.com/u/Andrei_Costescu)\
**Post date:** [April 9, 2010, 2:06pm UTC](https://forum.servoy.com/t/form-in-dialog-popped-on-a-second-monitor/11909/6 "2010-04-09T14:06:49Z")

</div>

If you open the main smart client window on monitor 1 and move it to monitor 2 then close it, does it show on monitor 2 after restart?

---

<div class="post-metadata">

**Author:** ![diana.bodnarescu](https://avatars.discourse-cdn.com/v4/letter/d/a88e57/32.png) [@diana.bodnarescu](https://forum.servoy.com/u/diana.bodnarescu)\
**Post date:** [April 9, 2010, 3:43pm UTC](https://forum.servoy.com/t/form-in-dialog-popped-on-a-second-monitor/11909/7 "2010-04-09T15:43:29Z")

</div>

> If you open the main smart client window on monitor 1 and move it to monitor 2 then close it, does it show on monitor 2 after restart?

As it starts, It looks like it wants to show in the second monitor, but when the application is fully open,it moves to the 1st monitor.

---

<div class="post-metadata">

**Author:** ![Andrei\_Costescu](https://avatars.discourse-cdn.com/v4/letter/a/e36b37/32.png) [@Andrei\_Costescu](https://forum.servoy.com/u/Andrei_Costescu)\
**Post date:** [April 9, 2010, 4:26pm UTC](https://forum.servoy.com/t/form-in-dialog-popped-on-a-second-monitor/11909/8 "2010-04-09T16:26:42Z")

</div>

It should be shown on monitor 2, if it was completely contained in monitor 2 bounds… It might be related to your initial problem as well.  
Please create a case in our Support System for this.

One more question: was the window maximized before close? Unfortunately I don’t have a second monitor at my disposal right now.

---

<div class="post-metadata">

**Author:** ![diana.bodnarescu](https://avatars.discourse-cdn.com/v4/letter/d/a88e57/32.png) [@diana.bodnarescu](https://forum.servoy.com/u/diana.bodnarescu)\
**Post date:** [April 9, 2010, 4:30pm UTC](https://forum.servoy.com/t/form-in-dialog-popped-on-a-second-monitor/11909/9 "2010-04-09T16:30:38Z")

</div>

> was the window maximized before close?

Yes it was maximized before close.  
Can you please tell me how this explains the problem I am having? Thank you in advance.

---

<div class="post-metadata">

**Author:** ![Andrei\_Costescu](https://avatars.discourse-cdn.com/v4/letter/a/e36b37/32.png) [@Andrei\_Costescu](https://forum.servoy.com/u/Andrei_Costescu)\
**Post date:** [April 9, 2010, 4:52pm UTC](https://forum.servoy.com/t/form-in-dialog-popped-on-a-second-monitor/11909/10 "2010-04-09T16:52:55Z")

</div>

> diana.bodnarescu:  
> Can you please tell me how this explains the problem I am having?

getWindowX()/getWindowY() might return a location relative to the screen a window is shown in (at least in your specific monitor configuration). I think you are using these. And the same values are used internally when we try to show the main app. window where it was closed. There is an alternate way to determine these that might be better in case of multiple screens.

But this is just a hunch, as I saw this working with multiple monitors in the past, and using the same coordinates.

---

<div class="post-metadata">

**Author:** ![diana.bodnarescu](https://avatars.discourse-cdn.com/v4/letter/d/a88e57/32.png) [@diana.bodnarescu](https://forum.servoy.com/u/diana.bodnarescu)\
**Post date:** [April 12, 2010, 7:57am UTC](https://forum.servoy.com/t/form-in-dialog-popped-on-a-second-monitor/11909/11 "2010-04-12T07:57:29Z")

</div>

> There is an alternate way to determine these that might be better in case of multiple screens.

Could you please tell me what this is?

---

<div class="post-metadata">

**Author:** ![Andrei\_Costescu](https://avatars.discourse-cdn.com/v4/letter/a/e36b37/32.png) [@Andrei\_Costescu](https://forum.servoy.com/u/Andrei_Costescu)\
**Post date:** [April 12, 2010, 8:09am UTC](https://forum.servoy.com/t/form-in-dialog-popped-on-a-second-monitor/11909/12 "2010-04-12T08:09:52Z")

</div>

It won’t help you - it’s an alternate way for us to get the location internally. You would need a reference to the Java window object which you don’t normally have.

---

<div class="post-metadata">

**Author:** ![diana.bodnarescu](https://avatars.discourse-cdn.com/v4/letter/d/a88e57/32.png) [@diana.bodnarescu](https://forum.servoy.com/u/diana.bodnarescu)\
**Post date:** [April 12, 2010, 8:19am UTC](https://forum.servoy.com/t/form-in-dialog-popped-on-a-second-monitor/11909/13 "2010-04-12T08:19:43Z")

</div>

> It won’t help you - it’s an alternate way for us to get the location internally. You would need a reference to the Java window object which you don’t normally have.

Thank you for all your answers Andrei,  
So the conclusion is there is no way I can accurately store that the form in dialog was displayed on a second monitor? And I need to make a case in the Servoy case system?  
Diana

---

<div class="post-metadata">

**Author:** ![Andrei\_Costescu](https://avatars.discourse-cdn.com/v4/letter/a/e36b37/32.png) [@Andrei\_Costescu](https://forum.servoy.com/u/Andrei_Costescu)\
**Post date:** [April 12, 2010, 8:36am UTC](https://forum.servoy.com/t/form-in-dialog-popped-on-a-second-monitor/11909/14 "2010-04-12T08:36:38Z")

</div>

Please create a case in our Support System as I said earlier so we can have a look.  
Mention your problem as well as what I asked you to test with the main smart client window.

Thanks.
