Picture of Fabio Beoni
this.setCompletionStatus() undefined
by Fabio Beoni - Thursday, 22 December 2016, 2:08 PM
 

Hi,

I'm developing a component and I would set the completion status when the user does something on it.

In one of the component methods I then invoke this.setCompletionStatus() but I get undefined.

Is this method available to all components definitions derived by ComponentView.extend({});  ?

Thanks, F.

Picture of Fabio Beoni
Re: this.setCompletionStatus() undefined
by Fabio Beoni - Wednesday, 28 December 2016, 3:06 PM
 

Any suggestion? Thanks

Picture of Matt Leathes
Re: this.setCompletionStatus() undefined
by Matt Leathes - Tuesday, 3 January 2017, 12:30 PM
 

When you say you 'get undefined'... what do you mean? This method does not return a value; calling it sets two properties - _isComplete and _isInteractionComplete - to true, should the component be visible at the time it is called.

Picture of Fabio Beoni
Re: this.setCompletionStatus() undefined
by Fabio Beoni - Wednesday, 4 January 2017, 9:16 AM
 

Hi,

I mean, "this" doesn't have a "setCompletionStatus". The invocation happen in a method defined in the component definition. The key "this" doesn't return the component it-self, it returns the global window object. But I think it depends because the completeComponent() function is invoked as callback of a "onClick" event in Google Map marker.

I changed the code by calling the component differently. Thanks.

var component = ComponentView.extend({

completeComponent:function () {
    //this.setCompletionStatus();

     component.setCompletionStatus();
}

});