I have got this code which register a callback method.
function BaseClass() {
var context = this;
(function initialize() {
context.registerField(context.Name, function updateValues(Name, value) {
context.Value = value;
});
})();
}
This is how the callback methods are being called.
updateValues.call(null, names, values);
The issue is the registerfield() is called multiple times with different context.
When the call back are being called they are not getting executed on correct context. How can I invoke the callback on correct objects? updateValues.call(null, names, values);