determining form width before onLoad Servoy 6

I Servoy 5.2.9 when I do this before the onLoad:

var w = forms[child_frm].controller.getFormWidth()

the result is 0. After the onLoad the result is the correct width.

If I do this same in Servoy 6 it [properly I assume] throws an exception indicating that controller is not yet defined.

How am I able to determine a form width programmatically in Servoy 6. Note that I do not use the SolutionModel since I imported from 5.2.9. where it was not used.

(I did not see any references in the forum/wiki on this topic).

Thomas Parry:
If I do this same in Servoy 6 it [properly I assume] throws an exception indicating that controller is not yet defined.

Hi Thomas,

I think you see an error like this: ‘TypeError: Cannot read property “controller” from undefined’
This means that actually the variable ‘child_frm’ doesn’t point to a correct formname at that point.

Best thing you can do is debug the method and check what’s in ‘child_frm’.

Hope this helps