Hello,
i have, for a long time, had a custom datasource for "position" fields. The reason for this was originally that localization made floats look different and in some instances not work with google maps and/or sending back to server.
I therefor had a need to have certain types of float fields always be serialized up and down the same way.
I set it up according to this thread: https://forums.smartclient.com/forum...ng-and-editing
I then use the type in my datasource xml definition like this:
This has worked for several years, and still do. However, i just noticed something in the logs that i haven't looked at in a long while. The server logs is overrun with smartclient rows of the type:
It seems as though it is because it does not recognize the position custom type?
So, my questions:
1. Is this still the best way to get global formatting of certain types of fields, or would you recommend something else?
2. What can i do to get rid of the server-side logs?
for reference, here is how i register the custom datatype client-side:
i have, for a long time, had a custom datasource for "position" fields. The reason for this was originally that localization made floats look different and in some instances not work with google maps and/or sending back to server.
I therefor had a need to have certain types of float fields always be serialized up and down the same way.
I set it up according to this thread: https://forums.smartclient.com/forum...ng-and-editing
I then use the type in my datasource xml definition like this:
Code:
<field name="lon" type="position" length="256" required="true" hidden="false"> <validators> <validator type="isFloat"/> </validators> </field>
Code:
2018-11-12 10:44:56.307 DEBUG com.isomorphic.store.DataStructCache - getInstanceFile (failure): 'position' instance of datasources: 0ms 2018-11-12 10:44:56.307 DEBUG c.i.d.PoolableDataSourceFactory - Tried to create DataSource of type 'position' but null was returned
So, my questions:
1. Is this still the best way to get global formatting of certain types of fields, or would you recommend something else?
2. What can i do to get rid of the server-side logs?
for reference, here is how i register the custom datatype client-side:
Code:
private static native void createNumericSimpleType(String name) /*-{ $wnd.isc.ClassFactory.defineClass(name, "TextItem"); $wnd.isc.ClassFactory.getClass(name).addProperties({ mapDisplayToValue : function(value) { retVal = @xxx.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 @xxx.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 @xxx.CustomDataSourceTypesFactory::formatNumericValue(Ljava/lang/String;D)(name, value); } } }); }-*/;
Comment