Announcement

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

    DynamicForm doesn't send null value when client side validation fails and then passes

    Hello,

    It looks like there's an issue with DynamicForm not sending null value if the client side validation fails at first, but then user corrects the issue and resubmits the form. The issue was observed using SmartClient Version: v10.0p_2014-12-09/Enterprise Deployment (built 2014-12-09)
    Steps to reproduce:
    1. start builtinds sample application
    2. Select Employees datasource on the left hand side
    3. Select the second row, Tamara Kane
    4. Change status field in the dynamic form in the middle of the screen from "active" to nothing
    5. Change the required field Employee ID from 182 to nothing
    6. hit Save button
    7. Change Employee ID field to 182
    8. hit Save button
    9. observe that the submitted request doesn't include EmployeeStatus field
    10. select any other row in the grid and then select the second row again
    11. Verify that the Status has not been changed.

    The same scenario works just fine when editing within ListGrid.

    #2
    maybe related to:
    [bug] DynamicForm fields with NULL values are missed then `redrawOnChage: true`

    http://forums.smartclient.com/showthread.php?t=31976

    I haven't got a any reply for a month so I've patched SmartClient by myself.

    Code:
    // in method `DataBoundComponent._clearFieldValue`
    
    _clearFieldValue : function (field, values, component, useFirstEntryImplicitly) 
    {
        var dataPath = field;
        if (isc.isAn.Object(field) && !isc.isA.Date(field)) {
            dataPath = this._getDataPathFromField(field, component);
        } else {
            // If we were passed a string, don't pass it into pAOV as the field param - otherwise
            // that method would have to check for the param being a non-null non-object.
            field = null;
        }
    
    // <- comment out this line -->
    //    this._performActionOnValue("clear", dataPath, field, values, component, useFirstEntryImplicitly,
                null, false); // <- this line causes deletion of null field, so they are not submitted to server.
    },
    This happens then DynamicForm redraw occurs.
    It`s really a little hack, but fundamental fix would need more effort, I think that`s why I am getting no response from anyone.

    Hope, this fix will help you.

    Comment


      #3
      Thank you very much for the clue. BTW, the issue is not present in SmartClient Version: v10.0p_2015-01-19/Enterprise Deployment (built 2015-01-19) I hope it's resolved.

      Comment


        #4
        Both the issue in this thread and in the linked thread are fixed for 5.0 and 4.1 (in today's build), and will shortly be fixed for development builds of 5.1 as well (should be tomorrow's build).

        Be sure to remove that patch, it would create other, subtle issues.

        Comment

        Working...
        X