How to remove _super warnings?

Questions, tips and tricks and techniques for scripting in Servoy

How to remove _super warnings?

Postby tkilshaw1553613063 » Wed Sep 28, 2022 8:34 pm

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
tkilshaw1553613063
 
Posts: 47
Joined: Tue Mar 26, 2019 5:11 pm

Re: How to remove _super warnings?

Postby Joas » Mon Oct 10, 2022 5:15 pm

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.
Joas de Haan
Yield Software Development
Need help on your project? yieldsd.com
User avatar
Joas
Site Admin
 
Posts: 842
Joined: Mon Mar 20, 2006 4:07 pm
Location: Leusden, NL

Re: How to remove _super warnings?

Postby tkilshaw1553613063 » Mon Oct 10, 2022 7:10 pm

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
tkilshaw1553613063
 
Posts: 47
Joined: Tue Mar 26, 2019 5:11 pm

Re: How to remove _super warnings?

Postby robert.edelmann » Tue Oct 11, 2022 2:14 am

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.
mit freundlichen Grüßen
Robert Stefan Edelmann
User avatar
robert.edelmann
 
Posts: 91
Joined: Wed Aug 14, 2013 6:12 pm

Re: How to remove _super warnings?

Postby tkilshaw1553613063 » Tue Oct 11, 2022 9:22 pm

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
tkilshaw1553613063
 
Posts: 47
Joined: Tue Mar 26, 2019 5:11 pm


Return to Methods

Who is online

Users browsing this forum: No registered users and 12 guests

cron