Announcement

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

    DataBoundComponent.fieldValuesAreEquals does not handle custom types

    Hi,
    I use the 8.3 latest nightly of 17th of april. I noticed that in some cases when saving a form that values changed on the server are not set back into the form.

    I debugged the code and it seems that the method DataBoundComponent.fieldValuesAreEqual does not handle custom types, even if the custom type extends date/datetime.

    So server-side changes in fields which have a custom simple type are not detected.

    It may make sense to even use the field.compareValues method. At least that solves it in our case.

    I did a local workaround for this and noticed something else also:
    - if the server changes a value then the form field is not refreshed, so with my workaround the change is detected, the value is set in the form but not directly in the formitem but through the _saveValues of the form.
    - In the _saveDataReply there is this code:
    currentValues[i] = data[i];
    hasChanges = true;
    when a value on the server changes, this results in this being executed:
    Code:
               if (hasChanges) {
                    // apply changed field values from data directly to this.values                
                    this._saveValues(currentValues);
                }
    which again results in that this is never done (as the internal form values are now the same as the server values and unequal to the submitted values):
    Code:
                     var submittedVal = isc.DynamicForm._getFieldValue(path, item, submittedValues, this);
    
                    if (this.fieldValuesAreEqual(item, submittedVal, this.getValue(path))) {
                        if (hasChanges) {
                            var serverVal = isc.DynamicForm._getFieldValue(path, item, data, this);
                            
                            if (!this.fieldValuesAreEqual(item, submittedVal, serverVal)) {
                                item.setValue(serverVal);
                            }
                        }

    Does it make somewhat sense what I am saying?

    gr. Martin
    Last edited by martintaal; 18 Apr 2012, 09:48.

    #2
    Bumped :-)

    Comment


      #3
      Sorry for the delay - we haven't got to the bottom of how exactly this should behave yet. We'll update when we have a solution (should be this week).

      Sounds like you have a workaround so this isn't actually blocking you, correct? If not let us know and we'll be sure to get to it sooner.

      Comment


        #4
        Hi,
        Thanks for your response, it would be great to have a solution, I try to prevent these work arounds...

        You mentioned a week, that would be great.

        gr. Martin

        Comment


          #5
          This should be resolved in the next nightly build.
          Let us know if you continue to hit it

          Regards
          Isomorphic Software

          PS: Thanks for the debugging efforts. Your analysis made fixing this quite straightforward.

          Comment


            #6
            Thanks for this was http://www.ashburnham-insurance.co.u...insurance.html fixed?
            Last edited by nathan3011; 9 Jul 2012, 01:35.

            Comment

            Working...
            X