Static class implementing IConstantsObject not recognized

Hi,

I have a plugin which returns an object implementing IConstantsObject.
This object is just a static class (no methods, only public static final variables in it).

If I don’t call one method of my plugin before calling one of the constants, Servoy is giving me that error:
ReferenceError: “XXXX” n’est pas défini (E:\servoy_workspace5\mediatest\forms\formTest.js#14)

Where XXXX is the name of my object. But being public static, I don’t need (and don’t want to instantiate an object to be able to use the constants).

Actually this is true of all plugins and objects: try using JSClient.CALLBACK_EVENT in your script without having first used the plugin and you will also get:
ReferenceError: “JSClient” n’est pas défini (E:\servoy_workspace5\mediatest\forms\formTest.js#14)

I think it defeats the purpose of having constants in the first place. These should be available without having to instantiate anything.

Could you have a look at this?
Thanks in advance,

problem is that currently we only know what return types to register
when we construct the plugin.

So if we would do it upfront then we have to instantiate all the plugins and then call getScriptObject() on all of them to get the ScriptObjects of the plugins so that we can ask for there return types.

Now that last part is lazy so that we dont need to really create an instance of everything.

I guess for this we need upfront some configuration or something like specifying in the manifest.mf what your return types are.

I see… now adding some declaring info in the manifest is certainly doable in our end, but what would be the format for this?

that should first be specified…
But something like the Java-Bean:

Name: com.patrick.talbot.plugin.Greatness
Servoy-Constant: True

Please make a case for this.

jcompagner:
that should first be specified…
But something like the Java-Bean:

Name: com.patrick.talbot.plugin.Greatness
Servoy-Constant: True

Please make a case for this.

Yes, I really like you package! ;-)
Will make a feature request.

Thanks,