Quantcast
Channel: SmartClient Forums
Viewing all articles
Browse latest Browse all 4756

[bug] __cacheType in DataSourceLoader generated code overrides builtinTypes

$
0
0
Hi,

Version v10.0p_2015-04-19/EVAL Deployment (2015-04-19)

I don't know when this happens, but sometimes the generated code from DataSourceLoader includes validators for joined fields from other datasources that look something like:

Code:

{
    __cachedType: isc.SimpleType.create({
      validators: ["isString", {
        max: 10,
        type: "lengthRange"
      }],
      name: "text"
    }),
    hidden: true,
    canEdit: false,
    name: "Name",
    length: 10,
    columnCode: "b35fd19cac14608b161d0c2a1b173f97",
    type: "text"
  },

When SimpleType.create() is called, the default type isc.builtinTypes.text gets overridden with this new type.

After the datasources are generated, whenever a DataSource gets used in a Form, SimpleType.addTypeDefaults gets called which assigns the overridden builtinTypes to all the (in this case text-) field. The effect is that all the fields are affected by whichever lengthRange restriction appears last in the generated code from DataSourceLoader.

Cheers

Viewing all articles
Browse latest Browse all 4756

Trending Articles