Announcement

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

    Bugs in ISC_Core addTypeFieldProperties

    SmartClient Version: v10.0p_2015-12-03/LGPL Deployment (built 2015-12-03)

    After upgrading from v10.0p_2015-10-01/LGPL Deployment to v10.0p_2015-12-03/LGPL Deployment my SimpleTypes stopped working.

    A cup of tea helped solve the problem (bold & underlined texts are my additions to released code):


    addTypeFieldProperties : function (field, type) {
    if (type && type.fieldProperties) {
    var finalField = {};
    for (var property in type.fieldProperties) {
    // Duplicate editorProperties - we manipulated it directly on the
    // widget and don't want to pollute the version on the type object

    if (property == "editorProperties") {
    finalField[property] = isc.addProperties({}, property); // ??? is this correct ? I had no Type with editorProperties to test it, but it looks fishy
    } else {
    finalField[property] = type.fieldProperties[property]; // BUG: finalField.align = "align" NOT finalField.align = "center"
    }
    }
    // Allow explicit entries to clobber those picked up from the type.
    return isc.addProperties(finalField, field); // BUG: no return
    }
    return field;
    },

    #2
    We appreciate the attempt to patch, but we can't accept a patch without seeing a test case that should work but fails without your patch.

    This is because we fairly often receive patches that actually work around a bug in application code - and we don't want that, for obvious reasons.

    Comment


      #3
      OS Win, Chrome 47.0.2526.73 m, SmartClient Version: v10.0p_2015-12-05/LGPL Deployment (built 2015-12-05)

      Could not upload simple_types_ignored.html via Upload Attachments button as is says:

      This is not a valid image file. simple_types_ignored.html

      So, here is the test case:
      Code:
      <!DOCTYPE html>
      <html>
      <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Test Case 4 ISC</title>
        <script>var isomorphicDir = "../../isomorphic/"</script>
          <script src=../../isomorphic/system/modules/ISC_Core.js></script>
          <script src=../../isomorphic/system/modules/ISC_Foundation.js></script>
          <script src=../../isomorphic/system/modules/ISC_Containers.js></script>
          <script src=../../isomorphic/system/modules/ISC_Grids.js></script>
          <script src=../../isomorphic/system/modules/ISC_Forms.js></script>
          <script src=../../isomorphic/system/modules/ISC_DataBinding.js></script>
          <script src=../../isomorphic/skins/SmartClient/load_skin.js></script>
      </head>
      <body>
        <script type="text/javascript">
        isc.SimpleType.create({
          name: 'customInteger',
          fieldProperties: {
              align: 'center',
              width: 75
          },
          inheritsFrom: 'integer'
        });
        isc.SimpleType.create({
          name: 'customText',
          fieldProperties: {
              align: 'center',
              filterEditorProperties: { operator: 'contains', hint: 'Filter...', showHintInField: true },
              width: 75
          },
          inheritsFrom: 'text'
        });
        isc.SimpleType.create({
          name: 'customFloat',
          fieldProperties: {
              align: 'center',
              cellAlign: 'right',
              width: 75
          },
          inheritsFrom: 'float'
        });
        
            var testData = [
                {price:15,desc:'Integer',numf:1.0,numi:15},
                {price:23,desc:'Custom Text',numf:1.0,numi:23},
                {price:10,desc:'Custom Float',numf:1.0,numi:10},
                {price:31,desc:'Custom Integer',numf:1.0,numi:31}
            ];
        
            var simpleGrid = isc.ListGrid.create({
                align: 'center',
                autoFetchData: true,
                data: testData,
                headerHeight: 44,
                selectionType: 'single',
                showFilterEditor: true,
                width: '516',
                fields:[
                    {name: 'price', title: 'Integer', type: 'integer', width: 125},
                    {name: 'desc', title: 'Custom Text', type: 'customText', width: 125},
                    {name: 'numf', title: 'Custom Float', type: 'customFloat', width: 125},
                    {name: 'numi', title: 'Custom Integer', type: 'customInteger', width: 125}
                ]
            });
        
            isc.VLayout.create({
              autoDraw: true,
              height: '100%',
              padding: 0,
              position: 'relative',
              width: '100%',
              members: [
                simpleGrid
              ]
            });
        </script>
      </body>
      </html>
      P.S. As a side note, I noticed some javascript errors on browsers' console while posting this post. I had to reload the page to see my submitted entry.
      Last edited by szymko.k; 5 Dec 2015, 10:04.

      Comment


        #4
        This issue has been fixed. Please try the next nightly build, dated December 10.

        Thanks for the fix.

        Regards
        Isomorphic Software

        Comment

        Working...
        X