Form in dialog popped on a second monitor

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

Why are you storing FID positions?

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

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

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.

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

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?

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.

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.

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.

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.

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?

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.

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

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.