Announcement

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

    NestedEditorItem not firing changed() event

    Hello,

    I'm back to coding after a long absence and have had need of a complex editor. In my case, my datasource contains one text field and a boolean. The 'editor' for this widget should be a text form with a checkbox next to it.

    I used NestedEditorItem (I know it was 'experimental' last time I looked at it years ago). When I check/uncheck the checkbox in my custom editor I expect the changed() event to be fired on my editor but it is being fired approximately every 3-4 clicks.

    Upon investigation I have determined that the following code may not be behaving as expected in the nestedEditorItem code:
    Code:
        editorDefaults: {
            itemChanged : function (item, newValue) {
                var values = this.creator.isCriteriaEditor ? this.getValuesAsCriteria()
                                : this.getValues();
                this.creator.updateValue(values);
            }
        }
    Specifically, the call to this.getValues() always returns the recently updated object which then gets passed to the compareValues() function and this returns true since it doesn't see any change.

    I have fixed this temporarily for my case using the following code in my editor properties:
    Code:
    compareValues: function(newValue, showValue) {
             if ( isc.isAn.Object(newValue) ) {
                 return false;
             }
             else {
                 return this.Super("compareValues", arguments);
             }
         }

    Not sure 'where' the actual culprit is but will save the digging for another day. Wanted to raise it here in case someone else facing the same problem needed a hand.

    ISC version: v10.0p_2014-11-26/LGPL Deployment
    Browser: Firefox 33.1 (OS X Yosemite)

    If you would like a reproducible test case I am sure I could knock one together

    #2
    We've now made a change to the NestedEditorItem to make change handlers fire as expected
    Please try the next nightly build, dated Dec 16 or above [10.0 or 10.1 branch].

    Regards
    Isomorphic Software

    Comment

    Working...
    X