# GetActiveWindow not returning current active window form

**URL:** <https://forum.servoy.com/t/getactivewindow-not-returning-current-active-window-form/20325>\
**Category:** Questions\
**Created:** [September 23, 2020, 1:04pm UTC](https://forum.servoy.com/t/getactivewindow-not-returning-current-active-window-form/20325 "2020-09-23T13:04:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dev-ws-011](https://avatars.discourse-cdn.com/v4/letter/d/ac8455/32.png) [@dev-ws-011](https://forum.servoy.com/u/dev-ws-011)\
**Post date:** [September 23, 2020, 1:04pm UTC](https://forum.servoy.com/t/getactivewindow-not-returning-current-active-window-form/20325/1 "2020-09-23T13:04:31Z")

</div>

Hi All,

I am working with NG Desktop client application. I observed a problem in NG Client with application.getActiveWindow().controller.getName() that it is not returning current active window controller name at time of **‘onResize’ event** and after form is loaded/shown completely, it then returns correct form name.

However, in Smart Client it returns correct form name i.e. current active window controller name even at **‘onResize’ event** , this seems to be change in functionality.

Any help is highly appreciated.

Attached a demo solution to reproduce the scenario. Run the same solution in Smart Client and NG Client, after generating popup you will notice difference in **‘Parent Form (At Resize event): \<form\_name\>’**.

Steps to run demo:

1. Click ‘Generate Popup’ on main form
2. Popup is displayed with a nested form with boundary. This nested form will be displaying the Parent Form fetched at ‘onResize’ event.
3. To check Parent form after nested form is loaded/shown, click ‘Fetch Parent Form Name’. (In NG Client, incorrect form name is displayed at ‘onResize’ event, while correct form is fetched after form is loaded.)

Regards

 ![ActiveWindowControllerName(SmartClientvsNGClient).png](https://canada1.discourse-cdn.com/flex010/uploads/servoy/original/1X/b66edeb090fdffbc27a4d1c7d6ebd3e7ce995a5c.png)

[demo\_two.servoy](https://forum.servoy.com/uploads/short-url/fdAoN4bgfYhWmp9fe5OZKoQKCQz.servoy) (6.54 KB)

---

<div class="post-metadata">

**Author:** ![mboegem](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/mboegem/32/4399_2.png) [@mboegem](https://forum.servoy.com/u/mboegem)\
**Post date:** [September 23, 2020, 8:46pm UTC](https://forum.servoy.com/t/getactivewindow-not-returning-current-active-window-form/20325/2 "2020-09-23T20:46:53Z")

</div>

What are you trying to achieve in the onResize event?

I’ve often used it to center elements and keep them there.  
In NG this can be done way better using css.

---

<div class="post-metadata">

**Author:** ![dev-ws-011](https://avatars.discourse-cdn.com/v4/letter/d/ac8455/32.png) [@dev-ws-011](https://forum.servoy.com/u/dev-ws-011)\
**Post date:** [September 24, 2020, 2:49pm UTC](https://forum.servoy.com/t/getactivewindow-not-returning-current-active-window-form/20325/3 "2020-09-24T14:49:42Z")

</div>

In actual scenario, we have child forms ‘FormA’ & ‘FormB’ which are displayed in two different screens.

-One is having 2 split panels(having FormA as top split panel, and FormB as bottom split panel), so rearranging divider in either top split panel or bottom split panel, will rearrange divider in other split panel. So, the form resizing only allowed here.

-Second is popup, which does not require rearranging as it is only split panel there and no need to rearrange divider for other.

Regards
