smartgwt 5.0p. Right now running on 2015-09-03 but has been like this for a while.
Hello. I have a datasource, location with a custom type, "position", that i've used for years without issue.
I register them using a native method, like this:
In my entrypoint, i register them like this:
and in my xml datasources, i have fields like this:
Now, since i upgraded my jars to nightly builds after the summer (kind of august and forward, it worked in may i think, can't say for certain), i get strange entries in the module log when i try to access the type of that DataSourceField:
Everything seems to work as usual, but i'd like to keep my logs clean and solve any potential issues. I don't understand what the issue might be, but perhaps you can help me finding out what's wrong.
Edit: i put a breakpoint on IDManager, registerID, this row: SC.logWarn("Object " + object + " cannot be registered with a null ID");
Hello. I have a datasource, location with a custom type, "position", that i've used for years without issue.
I register them using a native method, like this:
Code:
private static native void createNumericSimpleType(String name) /*-{
$wnd.isc.ClassFactory.defineClass(name, "TextItem");
$wnd.isc.ClassFactory.getClass(name).addProperties({
mapDisplayToValue : function(value) {
retVal = @com.karpet.nuba.gwtcommons.CustomDataSourceTypesFactory::parseNumericValue(Ljava/lang/String;Ljava/lang/String;)(name, value);
if (isNaN(retVal))
return value;
return retVal;
},
mapValueToDisplay : function(value) {
if (value == null)
return "";
else if (isNaN(value))
return value;
else {
return @com.karpet.nuba.gwtcommons.CustomDataSourceTypesFactory::formatNumericValue(Ljava/lang/String;D)(name, value);
}
}
});
$wnd.isc.SimpleType.create({name:name,
inheritsFrom:"float",
editorType:name,
normalDisplayFormatter:function(internalValue) {
return this.shortDisplayFormatter(internalValue);
},
shortDisplayFormatter:function(value) {
if (value == null)
return "";
else if (isNaN(value))
return value;
else {
return @com.karpet.nuba.gwtcommons.CustomDataSourceTypesFactory::formatNumericValue(Ljava/lang/String;D)(name, value);
}
}
});
}-*/;Code:
CustomDataSourceTypesFactory.registerNumericSimpleType("position", NumberFormat.getFormat(CommonConstants.DEFAULT_NUMBER_FORMAT));Code:
<field name="lat" type="position" title="Latitud" length="256" required="true" hidden="false">
<validators>
<validator type="isFloat"/>
</validators>
</field>Code:
ERROR: 14:27:47.186:WARN:Log:Object com.smartgwt.client.data.SimpleType@34f04eba cannot be registered with a null ID
com.smartgwt.client.core.JsObject$SGWT_WARN: 14:27:47.186:WARN:Log:Object com.smartgwt.client.data.SimpleType@34f04eba cannot be registered with a null ID
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:105)
at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:172)
at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessagesWhileWaitingForReturn(BrowserChannelServer.java:338)
at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:219)
at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:136)
at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:576)
at com.google.gwt.dev.shell.ModuleSpace.invokeNativeVoid(ModuleSpace.java:304)
at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeVoid(JavaScriptHost.java:107)
at com.smartgwt.client.util.SC.logWarn(SC.java)
at com.smartgwt.client.util.IDManager.registerID(IDManager.java:121)
at com.smartgwt.client.core.BaseClass.registerID(BaseClass.java:79)
at com.smartgwt.client.core.BaseClass.internalSetID(BaseClass.java:102)
at com.smartgwt.client.data.SimpleType.setJavaScriptObject(SimpleType.java:170)
at com.smartgwt.client.data.SimpleType.<init>(SimpleType.java:186)
at com.smartgwt.client.data.SimpleType.getOrCreateRef(SimpleType.java:165)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:172)
at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessagesWhileWaitingForReturn(BrowserChannelServer.java:338)
at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:219)
at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:136)
at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:576)
at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:284)
at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91)
at com.smartgwt.client.data.SimpleType.getType(SimpleType.java)
at com.smartgwt.client.data.DataSourceField.getType(DataSourceField.java:2841)Everything seems to work as usual, but i'd like to keep my logs clean and solve any potential issues. I don't understand what the issue might be, but perhaps you can help me finding out what's wrong.
Edit: i put a breakpoint on IDManager, registerID, this row: SC.logWarn("Object " + object + " cannot be registered with a null ID");