Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    DataSource.Fields.Validators generate infinity dynamicErrorMessageArguments object

    Code:
     
                isc.DataSource.create({
                    ID:"countryDS",
                    fields: [
                        { name: "Id", hidden:true, primaryKey:true, type:"integer"},
                        { name: "countryName", title: "Country", type:"text" },
                        {
                            name: "countryCode", title: "Code", type: "text",
                            click: function () {
                                [B]var infinityObject = countryDS.fields["gdp"].validators[1].dynamicErrorMessageArguments;
                          debugger;[/B]
                            }
                        },
                        {
                            name: "gdp", title: "GDP ($B)", type: "float",
                            validators: [
                                {
                                    type: "floatRange",
                                    min: "1",
                                    max: "100",
                                    precision: "2",
                                    errorMessage: "Must enter 1-100"
                                }
                            ]
                        },
                    ],
                    clientOnly: true,
                    testData: [
                        { Id: 1, countryName: "United States", countryCode: "US", gdp:50},
                        { Id: 2, countryName: "China", countryCode: "CS", gdp: 70 },
                        { Id: 3, countryName: "Japan", countryCode: "JP", gdp: 55 },
                        { Id: 4, countryName: "Turkey", countryCode: "TR", gdp: 40 }
                    ]
                })
    
                isc.ListGrid.create({
                    ID:"countryGrid",
                    width: 500, height: 224, alternateRecordStyles: true,
                    dataSource: countryDS,
                    autoFetchData: true,
                    canEdit:true
                });
    SmartClient Version 10.1 Professional.
    Firefox 43.0.4
    Chrome 53.0.2785.143

    I added floatRange validator to gdp field. After floatRange validator working,generates infinity dynamicErrorMessageArguments object in floatRange Validator object . I also tried this code in Feature Examples code panel. I getting same problem. Simply you look at infinityObject in code.

    Best Regards...

    #2
    What do you mean by calling this an "infinity object"? That there are looping references?

    If so, why would that be a problem? Are you trying to serialize DataSource.fields or something?

    Comment


      #3
      Yes. There are looping references and we trying to serialize DataSouce.Fields.

      Comment


        #4
        The presence of looping references within DataSource.fields is not a bug. If you want to serialize, you need to use a list of valid properties. This will also stop you from serialize government other state which would not be valid to capture and apply on initialization.

        Comment


          #5
          I think is will not be stopping situation because I am deleting dynamicErrorMessageArguments in datasource.Fields when serializing datasource.Fields. So there are any problems on initialization!

          Will looping refenrences are be when I use floatRange validator everytime? If it will be, are there any problems at runtime or delaying using webpages or growing size (KB) of webPages?

          Comment


            #6
            You cannot use a naive serializer that just serialize get everything blindly. Looping references may appear due to the use of any feature, now or in the future.

            These looping references have no impact on memory usage.

            Comment

            Working...
            X