Servoy 6.0 alpha 5

We are pleased to announce the immediate availability of Servoy 6.0 a5

This version is available through the download option on the Servoy website and auto update.
Always make a backup of your current Servoy installation (directory and database) before installing/upgrading.
To update a Servoy 6.x eclipse open “Check for updates” via help menu.

For all the highlights read the wiki

Changes
[fix] 356267 application.getActiveClientCount(true) useless in login solution
[fix] 360109 Calculation blocks application
[fix] 359819 Date/time has some issues considering day-saving times
[fix] 360401 Problems with field selectOnEnter property
[fix] 360872 Selected record not shown in FormInDialogs
[fix] 360866 persistent value lists onscreen

Webclient changes
[fix] 360228 webclient tableviews with scrollbar always enabled show 2 scrollbars
[fix] 356224 Form Inheritance and WebClient behaviour issue
[fix] 357645 WC html area editor and anchoring does not work
[fix] 357763 HTML editor in firefox does not work correct
[fix] 360536 Stream File to Application server service fails in webclient

Developer changes
[enh] 347681 small interactive console enhances
[fix] 353439 Serclipse Builder: type interference not working for var x = y||z when y and z are typed
[fix] 360541 DLTK: builder marker on calling function with String param while passing a String containing nulls
[fix] 360543 DLTK: no warning generated for functions that don’t return what the JSDoc specifies or vise versa
[fix] 360503 DLTK: support missing for “optional” on object property params
[fix] 342804 The builder should generate warnings if the typing info in JSDoc uses unknown types
[fix] 360576 checking for stale forms should not be done by a background calculation also should be reported as a JSError (a developer only error)

Application server changes
[fix] 360898 DB2/400 - problems with IN operator in JOIN clause
[fix] 360899 DB2/400 - Problems with TEMP tables
[fix] 352201 Different Column Type Creation between Developer and Server
[fix] 359901 Case-insensitive operator in relation is not being supported by the app server
[fix] 356344 Large text is imported as text in stead of ntext

Plugin changes
[chg] 361728 Update all plugin jars to latest stable versions (jar version info will be published in wiki docs of 6.0)
[fix] 352507 Spellcheck plugin does not replace wrong words
[fix] 361509 webservice post data: array elements cannot be accessed in scripting

Hi all,

I noticed that the method databaseManager.getFoundSetDataProviderAsArray is now deprecated - what is its replacement?

As a side note, can the warning messages for the deprecated methods be extended to include some reference for the replacement method which should be used.

databaseManager.convertToDataSet(Object) is the replacement
I think this is not possible in eclipse to include reference in warning, we do have a reference in the wiki reference guide.

Hello and congratulations on the release!

Regarding…

[fix] 360543 DLTK: no warning generated for functions that don’t return what the JSDoc specifies or vise versa

Some datatypes (primitives for example) in JS are lowercase, however I have noticed that often Servoy uses title case versions of them in their auto-generated doc blocks. For example, I have seen “Number,” “String,” and “Object” (object not primitive, but you get the point).

All of my doc blocks use lowercase datatypes “number,” string," “object” etc. (for true JS datatypes anyway, not something like JSRecord), and so I am wondering if @return {object} will warn, when @return {Object} will not?

I think the warning should ignore case b/c in reality…

 var x = {a: 'b'};
typeof(x) === 'Object'

… will return false.

Whereas…

 var x = {a: 'b'};
typeof(x) === 'object'

… will return true.

Jan Blok:
databaseManager.convertToDataSet(Object) is the replacement
I think this is not possible in eclipse to include reference in warning, we do have a reference in the wiki reference guide.

Jan,

Thanks for the quick response!

By “reference” I mean the name of the replacement method to be include in the description of the @deprecated tag so it shows up in the warning message and in the method code completion tooltip

Hi all,

When using arguments.callee in a function we are getting the warning: “The property callee is undefined in arguments”

Is this now supported or not? According to JavaScript documentation, when using Strict Mode the arguments.callee and arguments.caller are not available. Is this the case with Servoy? In 5.2.6 and earlier the callee was available.

arguments.callee is deprecated and shouldn’t be used anymore in javascript.
What i can do is make it a deprecated warning, it is of course also still available at runtime, but not really something we should keep supporting in code completion.

jcompagner:
arguments.callee is deprecated and shouldn’t be used anymore in javascript.
What i can do is make it a deprecated warning, it is of course also still available at runtime, but not really something we should keep supporting in code completion.

Johan,

Thanks for the update. We will take it out of our code.

A separate question:
In 6a5 we are still getting warnings like “Function funcName declares forms.sys_config_Types.ProgramScreenInfo
as type but returns forms.sys_config_Types.ProgramScreenInfo” (ProgramScreenInfo being a “custom type” - function, marked with @constructor which is used as “var a = new forms.sys_config_Types.ProgarmScreenInfo(…)”

In one of your previous posts you indicated that you were able to find a way to support the “custom types” - did this make it into the last release or will it come out in a future one? If it is included in the current release, do we need to do anything special to make this work?

Jeff:

in doc you can use lowercase just fine

it doesnt matter if you say

return {object} or return {Object}

we have aliases for that.

you really only should use it in doc and not in your code because in js it is Object or Number and not object or number …
Because yes in your example it prints ‘object’ but anything else it will not work:
you can’t do

new object()
or
variable instanceof object

you have to do

new Object()
or
variable instanceof Object

rossen:

i just tried it in my code base and this works:

/**
 * @return {forms.other.MyObject}
 */
function test() {
	var x = new forms.other.MyObject();
	return x;
}

and that works fine for me currently.

Not everything completely works in that area like:

/**
 * @return {forms.other.MyObject}
 */
function test() {
	var x = new forms.other.getFunctionReturningMyObjectOfItSelf();
	return x;
}

that doesn’t really work yet and we are looking into that how that can work.

Hi Johan,

Thanks for the update. The example below is one of the usages which we have that are still not working correctly.

/**
 * @return {forms.other.MyObject}
 */
function test() {
        //the getFunctionReturningMyObjectOfItSelf function internally uses: " var a = new forms.other.MyObject();" which is returned
        /** @type {forms.other.MyObject} */
        var x = forms.other.getFunctionReturningMyObjectOfItSelf(); 
        
        //the properties of the custom type are not supported by the code completion here and in this scenario they produce warnings
        x.someProperty = 2;        

	return x;
}

it doesnt matter if you say

return {object} or return {Object}

we have aliases for that.

That’s good to know. Thanks Johan.

Regarding Object/object. That was perhaps a poor example because of the instanceof syntax, which BTW I think is unfortunate because there is in fact no Object datatype in JS (right?). instanceof actually checks for the class object/constructor function name, which for object is Object. But sticking to the primitives then how about the default docblock for onShow…

/**
 * Callback method for when form is shown.
 *
 * @param {Boolean} first_show form is shown first time after load
 * @param {JSEvent} event the event that triggered the action
 *
 * @properties={typeid:24,uuid:"93DBBD5A-CC24-486B-9A45-1210F2EF7039"}
 */

I don’t believe there is a Boolean object (@edit datatype) in JS. Boolean only exists in its primitive form “boolean” as does number and string. All of Servoy’s default doc blocks however use Number, String and Boolean (@edit which are objects with constructors of the same name), not number, string and boolean. Does that seem right to you/is there a reason for it? Really just more curious at this point - meaning I’m not asking for any changes or suggesting anything isn’t implemented properly.

In my opinion, using Boolean, String, Number, Date is better. It follows the naming convention of using Xxxxx for class/type names.
And since there is such a thing in JavaScript as Date.parse(), String.fromCharCode(), Number.MAX_VALUE , new Boolean(), new Array, etc., you can think of those as types or classes and it makes perfect sense to use the same in the JSDoc. Besides, this makes it consistent with the rest of the Servoy built-in types (JSFoundset, Form, Label, etc.)

rossent:
In my opinion, using Boolean, String, Number, Date is better. It follows the naming convention of using Xxxxx for class/type names.
And since there is such a thing in JavaScript as Date.parse(), String.fromCharCode(), Number.MAX_VALUE , new Boolean(), new Array, etc., you can think of those as types or classes and it makes perfect sense to use the same in the JSDoc. Besides, this makes it consistent with the rest of the Servoy built-in types (JSFoundset, Form, Label, etc.)

Well ultimately I suppose it is up to the developer, but there is no Date datatype in JS FYI. Date is the constructor function name for the Date class, which in itself will return an object. But that is not to say you can’t type check it to be Date, you can, but you have to use instanceof and not typeof.

Perhaps it’s all semantics, but I think it pays to be explicit. Meaning that if you are going to do:

var n = new Number();

Then your docblock could read

@param {object} n

or…

@param {Number} n

but in my opinion not…

@param {number} n

and definitely not…

@param {Object} n

So with all of that being said it really depends on what precisely you are passing around, but note there is a difference.

Although Johan!

I see that if I do firstShow instanceof Boolean (for a default Servoy onShow method) I get true, and if I do typeof(firstShow) I get boolean. I honestly don’t know how you did that because they are not synonymous in JavaScript and that can’t be replicated in scripting. I’m not sure how I can have instanceof Boolean be true and get typeof boolean??

If I try to replicate that I can’t…

function test() {
	var x = new Boolean(1);
	application.output(typeof(x));
	application.output(x instanceof Boolean);
}

I get object from typeof
and I get true from instanceof
(which is what I would expect)

Somehow your firstShow parameter is both Boolean and boolean!

jbader:
Although Johan!

I see that if I do firstShow instanceof Boolean (for a default Servoy onShow method) I get true, and if I do typeof(firstShow) I get boolean. I honestly don’t know how you did that because they are not synonymous in JavaScript and that can’t be replicated in scripting. I’m not sure how I can have instanceof Boolean be true and get typeof boolean??

If I try to replicate that I can’t…

function test() {
var x = new Boolean(1);
application.output(typeof(x));
application.output(x instanceof Boolean);

}



I get object from typeof
and I get true from instanceof
(which is what I would expect)

Somehow your firstShow parameter is both Boolean and boolean!

it is just a normal boolean

function test() {
	var x = true;
	application.output(typeof(x));
	application.output(x instanceof Boolean);
}

When you use “instanceof” with the primitive datatypes, you get the automatic wrapper object for them. Set x to 1 and you will “find” that it is both a number and Number, or set it to ‘s’ and it will be string and String…

yes i think that typeof is just strange…
dont know why you would really us that
instanceof seems to be way more specific gives you way more output the for many things then just ‘object’

js does know Date as a object type and everything is just Object

thats why when you create:

var x = true

and you give that to a function

you can use.

@param {Boolean}
@param {boolean}
@param {Object}
@param {object}

all 4 are fine to use

When you use “instanceof” with the primitive datatypes, you get the automatic wrapper object for them

I do not see that, and have never heard of that. Do you see something different?

js> 'test' instanceof String
false
js> 4 instanceof Number
false
js> false instanceof Boolean
false
js>

jcompagner:
yes i think that typeof is just strange…
dont know why you would really us that

typeof is necessary to discover datatypes.

instanceof seems to be way more specific gives you way more output the for many things then just ‘object’

instanceof won’t work on primitives at all (and does not discover datatypes). Its syntax requires a Class’ constructor name as the right hand operand and there is no constructor for the primitives. The proof to this is below…

false instanceof boolean

will throw an exception (unsupported operand really)!

So instanceof is there to tell you if a particular object is an instance of a particular class, and that isn’t synonymous with datatype in JS.

js does know Date as a object type and everything is just Object

It knows Date as an object yes, but not as a datatype. there is no Date/date datatype in JS.

thats why when you create:

var x = true

and you give that to a function

you can use.

@param {Boolean}
@param {boolean}
@param {Object}
@param {object}

all 4 are fine to use

Actually in that particular example true is primitive and is not Boolean, nor is it Object, nor even object. It is only primitive / boolean. So the docblock would only be accurate if it ready @param {boolean}

I mentioned before that I wasn’t really suggesting that anything was wrong with the Servoy implementation, but I think I am changing my mind b/c now that I see that somehow there are parameters being passed around that are somehow both (for example) Boolean and boolean, I believe that something is arye. Perhaps there is some inproper casting happening somewhere or an accessor has been overwritten? I don’t know how something can be both boolean and Boolean. Meaning it shouldn’t be possible for something to be an instance of Boolean and be primitive.

REMINDER: I’m only brining this up b/c of the following reported fix.

[fix] 360543 DLTK: no warning generated for functions that don’t return what the JSDoc specifies or vise versa

And I am thinking that if the editor is going to warn me about an improper return value, which does not match @returns it would be most useful if it caught differences between primitives and objects. Otherwise I suppose it is really only catching returning a string when you show @returns {Boolean} etc, and while that is really helpful, it’s easier to spot that on your own, whereas sometimes it’s harder to spot the other cases.

jbader:

When you use “instanceof” with the primitive datatypes, you get the automatic wrapper object for them

I do not see that, and have never heard of that. Do you see something different?

js> 'test' instanceof String

false
js> 4 instanceof Number
false
js> false instanceof Boolean
false
js>

I am not sure how you got your results, but they really are not the right thing expected. See the attachment from the interactive console.
Regarding the transient wrapper objects for the primitive datatypes in JavaScript - the best explanation which I have seen is in the book “JavaScript: The definitive Guide” by David Flanagan - there is a whole chapter on them.