Page 1 of 1

Hard to fix Warnings using JSDoc

PostPosted: Thu Nov 24, 2022 8:09 pm
by tkilshaw1553613063
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

Re: Hard to fix Warnings using JSDoc

PostPosted: Thu Nov 24, 2022 11:57 pm
by swingman
Hi, looking at the properties of your

oCurrForm

in developer, check the "encapsulation" properties...
I suspect "Hide Foundset" is ticked....

Re: Hard to fix Warnings using JSDoc

PostPosted: Fri Nov 25, 2022 6:07 pm
by tkilshaw1553613063
Thanks.
Where would that be found?

Re: Hard to fix Warnings using JSDoc

PostPosted: Fri Nov 25, 2022 6:23 pm
by tkilshaw1553613063
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.

Re: Hard to fix Warnings using JSDoc

PostPosted: Tue Nov 29, 2022 12:42 pm
by omar
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.