I’ve got an interesting form inheritance issue that only seems to happen under this unique situation. Basically, it seems that _super.methodName() in conjunction with the “this” keyword, seems to run out of context (at least in my opinion). Below is an example.
First, a global function, globals.Test1:
function global.test1(formObj){
application.output(formObj.formVar1)
}
Next, a base/parent form, lets call it Parent1, has something like this, where formVar1 is a form var:
var formVar1 = null; //formVariable
function test(){
globals.test1(this)
}
Finally, the child form, which extends Parent1, lets call it Child1:
//override parent method
function test(){
_super.test()
}
//override form var
function onLoad(){
formVar1 = "some value"
}
So, if you run forms.Child1.test() it will error. When it reaches the global method, its seems to have lost context. The value of formVar1 gets overridden on the child form, and if you test its value in the Parent1 form it also has the proper overridden value. However, when it reaches the global, it seems that when passing in “this” isn’t actually passing in the proper context and so the form variable isn’t showing as set. Seems like its getting a handle to the wrong instance. So, overriding the form variable works in Parent and Child as expected, but when the Parent form passes in “this” then it gets screwed up. If I pass in “this” from the Child form, then its fine, but I need it from the parent form.
Without this working, it makes some framework code more difficult