Page 1 of 1

How to remove _super warnings?

PostPosted: Wed Sep 28, 2022 8:34 pm
by tkilshaw1553613063
When Tuan first set us up he showed us how to create a base form and how to access methods in that base form.

So in the base.js we have:

Code: Select all
/**
* Callback method for when form is shown.
*
* @param {Boolean} bFirstShow
* @param {Object} oEvent
*
* @protected
*
* @properties={typeid:24,uuid:"13E99E18-1F08-4E93-840E-2CC758C06B77"}
* @AllowToRunInFind
*/
function onShow( bFirstShow, oEvent )
{


And in forms that inherit from base we have things like:

Code: Select all
/**
* @properties={typeid:24,uuid:"459A08C3-84AD-4233-9098-8AA55D6C42F2"}
* @override
*/
function onShow( bFirstShow, oEvent )
{
  _super.onShow( bFirstShow, oEvent );


But this leads to us getting Servoy warnings for every form that inherits from base and there are hundereds of them. Like:

Code: Select all
Description   Resource   Path   Location   Type
Reference to undeclared variable or property _super   _100_Company_Details_User.js   /qfi/forms   line 440   JavaScript Problem


Is there a way to avoid this?

thanks,

Terry

Re: How to remove _super warnings?

PostPosted: Mon Oct 10, 2022 5:15 pm
by Joas
Your code seems to be correct.
Are you sure the form with the warning still extends (inherits from) the base-form? This warning should only happen for forms that don't extend a super form. Check the "extendsForm" property of the form.

Re: How to remove _super warnings?

PostPosted: Mon Oct 10, 2022 7:10 pm
by tkilshaw1553613063
Thanks Joas.

Yes, all of the forms reporting this warning have an "extendsForm" value of "base [quantech_base]".
So "base" is in module "quantech_base" and that module is used by other modules in the solution.

Terry

Re: How to remove _super warnings?

PostPosted: Tue Oct 11, 2022 2:14 am
by robert.edelmann
Can you check the baseform, if there are errors in the code? like missing brackets?

This could lead to the parser not being able to find your functions in the baseform.

Look for "}" expected or error reading... in the warnings for the baseform.

Re: How to remove _super warnings?

PostPosted: Tue Oct 11, 2022 9:22 pm
by tkilshaw1553613063
I may have fixed it by changing:

Code: Select all
/**
* Callback method for when form is shown.
*
* @param {Boolean} bFirstShow
* @param {Object} oEvent
*
* @protected
*
* @properties={typeid:24,uuid:"13E99E18-1F08-4E93-840E-2CC758C06B77"}
* @AllowToRunInFind
*/
function onShow( bFirstShow, oEvent )


to

Code: Select all
/**
* Callback method for when form is shown.
*
* @param {Boolean} bFirstShow
* @param {JSEvent} oEvent
*
* @protected
*
* @properties={typeid:24,uuid:"13E99E18-1F08-4E93-840E-2CC758C06B77"}
* @AllowToRunInFind
*/
function onShow( bFirstShow, oEvent )


Does that seem possible?

thanks,

Terry