Quantcast
Channel: SmartClient Forums
Viewing all articles
Browse latest Browse all 4756

NestedEditorItem not firing changed() event

$
0
0
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

Viewing all articles
Browse latest Browse all 4756

Trending Articles