Hard to fix Warnings using JSDoc

Questions, tips and tricks and techniques for scripting in Servoy

Hard to fix Warnings using JSDoc

Postby tkilshaw1553613063 » Thu Nov 24, 2022 8:09 pm

On the Problems tab I see a bunch of Warnings like:

Description Resource Path Location Type
The property foundset is private qfi.js /quantech_base line 387 JavaScript Problem

And in the code it looks like this:

databaseManager.refreshRecordFromDatabase( oCurrForm.foundset, 0 );

With "foundset" underlined in the code to show the warning's focus.

This is in a scope defined in our base module. That scope is used in the main solution and in other modules that are part of the solution.

A similar problem in the same scope:

Description Resource Path Location Type
The property elements is private qfi.js /quantech_base line 393 JavaScript Problem

var oElement = oCurrForm.elements[sElementName];

With "elements" underlined in the code to show the warning's focus.

Is there a way to remove those warnings?

On a different topic, on the JSDoc page in the Servoy Wiki it says

RuntimeWebComponent type {RuntimeWebComponent<webComponentName>} @param, @return, @type
The webComponentName can be found in the associated spec file;
webComponentName may be for example: bootstrapcomponents-tabpanel (leading to the following type: {RuntimeWebComponent<bootstrapcomponents-tabpanel>} )

CustomType {CustomType<componentName.customTypeName>} @param, @return, @type
componentName may be web component or web service.
The customTypeName is defined in the spec file. Example: {CustomType<bootstrapcomponents-tabpanel.tab>}

Two questions:

1) where is the spec file that is mentioned?

2) How do you know if are you using a RuntimeWebComponent or a CustomType?

thanks,

Terry
tkilshaw1553613063
 
Posts: 56
Joined: Tue Mar 26, 2019 5:11 pm

Re: Hard to fix Warnings using JSDoc

Postby swingman » Thu Nov 24, 2022 11:57 pm

Hi, looking at the properties of your

oCurrForm

in developer, check the "encapsulation" properties...
I suspect "Hide Foundset" is ticked....
Christian Batchelor
Certified Servoy Developer
Batchelor Associates Ltd, London, UK
http://www.batchelorassociates.co.uk

http://www.postgresql.org - The world's most advanced open source database.
User avatar
swingman
 
Posts: 1479
Joined: Wed Oct 01, 2003 10:20 am
Location: London

Re: Hard to fix Warnings using JSDoc

Postby tkilshaw1553613063 » Fri Nov 25, 2022 6:07 pm

Thanks.
Where would that be found?
tkilshaw1553613063
 
Posts: 56
Joined: Tue Mar 26, 2019 5:11 pm

Re: Hard to fix Warnings using JSDoc

Postby tkilshaw1553613063 » Fri Nov 25, 2022 6:23 pm

I found the encapsulation properties in our base form in our base module and see that we have these checked:

Hide Dataproviders
Hide Foundset
Hide Controller
Hide Elements

And the same properties are also set in our 400+ forms.

I'll need to read about this before messing with them.

Many thanks for your post.
tkilshaw1553613063
 
Posts: 56
Joined: Tue Mar 26, 2019 5:11 pm

Re: Hard to fix Warnings using JSDoc

Postby omar » Tue Nov 29, 2022 12:42 pm

Hi, these properties don't do anything. They are only available to help you use good practices by generating JSDOC warnings. For example in formA you can make a button invisible in formB like this:
Code: Select all
forms.formB.elements.myButton.visible = false

However, this is considered bad practice. When Hide Elements is checked a JSDOC warning will be generated. The code still works however! When you uncheck it the warning goes away.
A better implementation would be to add a public method to formB (ie toggleButton) which you can call from formA.

Code: Select all
function toggleButton(show) {
  elements.myButton.visible = show
}


Then when you make a change in formB years later you won't have to worry as much about external dependencies that will break your code.
Intrasoft, Founder
Omar van Galen
[email protected]
+31-(0)6-21234586
Servoy Developer
omar
 
Posts: 379
Joined: Sat Feb 12, 2011 4:51 pm
Location: Intrasoft, The Netherlands


Return to Methods

Who is online

Users browsing this forum: Bing [Bot] and 2 guests

cron