ROCLASI:
globals.mainForm is a global variable that you have set in the dataproviders right ? (I know it’s not a table column).
So what is the media-type of this global ?
It’s not at all a field created in the design mode under dataproviders tab. It’s just a javascript global variable used within the method.
I think you know Servoy allows to declare a javascript variable as global.
for eg: you can in your method you can declare as
globals.anyName = “anything”
This value could be used in anyscript until the solution is closed
Thanks
I see why we didn’t understand each other at first.
As far as I know globals is a Servoy class.
I know you can define global javascript variables by not using var when assigning a variable a value for the first time.
But you are using globals.mainForm = forms.main;.
Instead you should use mainForm = forms.main;
Declaring global JavaScript variables by not putting var in front of the declaration created a global variable, but, according to the manual, the prefered way by Servoy is declaring it like globals.xxxx = value;
I think there is not much difference between the two and how the global variable is declared is probably not why Ahmad’s method isn’t working.
But, probably, it’s a clash of classes, in that a global cannot containt an form reference.
pbakker:
Declaring global JavaScript variables by not putting var in front of the declaration created a global variable, but, according to the manual, the prefered way by Servoy is declaring it like globals.xxxx = value;
I guess I should read the manual for once then
Anyway, I did some testing and indeed you can’t assign a form object to a globals.xxx variable.
Without the prefix globals. however it does work.