2021.3.3.3645_LTS Constructor Object undefined

Discuss all problems you have with Servoy here. It might help to mention the Servoy version and Operating System version you are using

2021.3.3.3645_LTS Constructor Object undefined

Postby briese-it » Tue Jun 07, 2022 11:24 am

I upgraded to 2021.3.3.3645_LTS and now the constructors have warnings.
For example the mod_dialogs "globals.DIALOGS.showErrorDialog()". Seems that Servoy doesn't recognizes the return values. Is this a bug or do I need to adjust the code?

Code: Select all

var DIALOGS = new function() {
/**
    * Show an error dialog
    *
    * @param {String} title
    * @param {String} message
    * @param {...String} buttons
    * @return {String}
    *
    * @SuppressWarnings(wrongparameters)
    */
   this.showErrorDialog = function(title, message, buttons) {
      if (application.getApplicationType() == APPLICATION_TYPES.NG_CLIENT) {
         return plugins.dialogs.showErrorDialog(title, message, getButtons(arguments));
      }
      return showDialog('dialogs_message', 'error', arguments, 'dialogs_icon_error');
   }
}
Attachments
2022-06-07 11_19_55-.png
2022-06-07 11_19_55-.png (12.55 KiB) Viewed 3386 times
Michael Harms
Briese Schiffahrts GmbH & Co.KG, Germany
- Servoy 2020.3.3.3565_LTS Running on Windows 2019 DataCenter - MSSQL2017 & PostGreSQL
User avatar
briese-it
 
Posts: 171
Joined: Mon Jun 20, 2011 1:50 pm
Location: Leer, Germany

Re: 2021.3.3.3645_LTS Constructor Object undefined

Postby jcompagner » Tue Jun 07, 2022 11:38 am

upgraded from which release?
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8829
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Re: 2021.3.3.3645_LTS Constructor Object undefined

Postby briese-it » Tue Jun 07, 2022 12:29 pm

Servoy 2020.03.3 LTS
Michael Harms
Briese Schiffahrts GmbH & Co.KG, Germany
- Servoy 2020.3.3.3565_LTS Running on Windows 2019 DataCenter - MSSQL2017 & PostGreSQL
User avatar
briese-it
 
Posts: 171
Joined: Mon Jun 20, 2011 1:50 pm
Location: Leer, Germany

Re: 2021.3.3.3645_LTS Constructor Object undefined

Postby jcompagner » Tue Jun 07, 2022 12:40 pm

i guess you didn't put the full source in right (so the js doc above that)

https://www.servoyforge.net/projects/mo ... bals.js#L2

because that should be ok because there is a @constructor (or @parse)

see the release notes of 2020.06:

https://wiki.servoy.com/display/DOCS/2020.06+Whats+new

"All these changes in the ScriptBuilder did result in that we needed to drop the "none shallow parsing" mode that we still had as an option in the preferences.
This option is removed and now the your javascript files are always build in shallow parsing mode, this means that having @param and especially @return is quite important to have (besides @constructor and @parse for functions that needs to be fully parsed anyway)"

so things like that (globals.DIALOGS) must be marked as @parse (or @constructor)
then i think it should be fine
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8829
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Re: 2021.3.3.3645_LTS Constructor Object undefined

Postby briese-it » Tue Jun 07, 2022 1:04 pm

I see but it was only a code snipped and the JSDoc looks fine:

Code: Select all
/**
* @constructor
*
* @description Dialog module - https://www.servoyforge.net/projects/mod-dialog
* @version 1.1.5
*
* Written by Robert J.C. Ivens and Paul Bakker
* OS dependent button-reverse patch by Harjo Kompagnie
*
* @properties={typeid:35,uuid:"EFF9564C-DBDB-4087-A9DF-A56826FE2CC7",variableType:-4}
*/
var DIALOGS = new function() {...
Michael Harms
Briese Schiffahrts GmbH & Co.KG, Germany
- Servoy 2020.3.3.3565_LTS Running on Windows 2019 DataCenter - MSSQL2017 & PostGreSQL
User avatar
briese-it
 
Posts: 171
Joined: Mon Jun 20, 2011 1:50 pm
Location: Leer, Germany

Re: 2021.3.3.3645_LTS Constructor Object undefined

Postby briese-it » Wed Jun 08, 2022 12:46 pm

Any other ideas?
Michael Harms
Briese Schiffahrts GmbH & Co.KG, Germany
- Servoy 2020.3.3.3565_LTS Running on Windows 2019 DataCenter - MSSQL2017 & PostGreSQL
User avatar
briese-it
 
Posts: 171
Joined: Mon Jun 20, 2011 1:50 pm
Location: Leer, Germany

Re: 2021.3.3.3645_LTS Constructor Object undefined

Postby mboegem » Wed Jun 08, 2022 1:41 pm

I've also seen this in my solutions.
Haven't tried yet, but it could be that @constructor only works on functions, not on variables defined as functions.

Just out of interest: are you using the dialog module because you are still running a web-client solution?
NG/Titanium client would not require this anymore as there is a direct replacement for the dialogs plugin. :D
Marc Boegem
Solutiative / JBS Group, Partner
• Servoy Certified Developer
• Servoy Valued Professional
• Freelance Developer

Image

Partner of Tower - The most powerful Git client for Mac and Windows
User avatar
mboegem
 
Posts: 1743
Joined: Sun Oct 14, 2007 1:34 pm
Location: Amsterdam

Re: 2021.3.3.3645_LTS Constructor Object undefined

Postby briese-it » Wed Jun 08, 2022 1:50 pm

Yes, Iam using Smart/Webclient. My solution is that big (abt. 150 modules) that there is currenctly no time to switch to NG.
Michael Harms
Briese Schiffahrts GmbH & Co.KG, Germany
- Servoy 2020.3.3.3565_LTS Running on Windows 2019 DataCenter - MSSQL2017 & PostGreSQL
User avatar
briese-it
 
Posts: 171
Joined: Mon Jun 20, 2011 1:50 pm
Location: Leer, Germany

Re: 2021.3.3.3645_LTS Constructor Object undefined

Postby briese-it » Tue Jun 14, 2022 4:48 pm

It seems that there is a bug regarding scopes. I created a test constructor:

1. Call the constructor with scopes.... gives warnings. No code completion

2. Call the constructor directly: Everything fine. Code completion works
Attachments
error.png
Warning, no code completion
error.png (24.82 KiB) Viewed 3194 times
running_.png
Running fine
running_.png (19.99 KiB) Viewed 3194 times
Michael Harms
Briese Schiffahrts GmbH & Co.KG, Germany
- Servoy 2020.3.3.3565_LTS Running on Windows 2019 DataCenter - MSSQL2017 & PostGreSQL
User avatar
briese-it
 
Posts: 171
Joined: Mon Jun 20, 2011 1:50 pm
Location: Leer, Germany

Re: 2021.3.3.3645_LTS Constructor Object undefined

Postby jcompagner » Tue Jun 14, 2022 5:14 pm

you now tell it that it needs to parse the variable (or see the variable as a constructor) but that is not what it needs to parse:

Code: Select all
var check = new /** @constructor */ function() {
   this.updateRecord = function() {
      
   }
}
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8829
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Re: 2021.3.3.3645_LTS Constructor Object undefined

Postby briese-it » Wed Jun 15, 2022 7:56 am

Hi Johan,
Thanks for the clarification. That also fixed my problem for the mod_dialog. Perfect.
Michael Harms
Briese Schiffahrts GmbH & Co.KG, Germany
- Servoy 2020.3.3.3565_LTS Running on Windows 2019 DataCenter - MSSQL2017 & PostGreSQL
User avatar
briese-it
 
Posts: 171
Joined: Mon Jun 20, 2011 1:50 pm
Location: Leer, Germany


Return to Discuss possible Issues and Bugs

Who is online

Users browsing this forum: No registered users and 6 guests

cron