cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Custom widget updateProperty will not called

Highlighted
Level 10

Custom widget updateProperty will not called

Hi,

I write a custom widget with a propery 'Data' with basetype INFOTABLE.

I use the widget in a mashup along with a line chart widget. I bind a data source (service which returns a infotable) to the 'Data'-field of my widget and to the 'Data'-field of the linechart. Additionally I add a button to the mashup. If I click on this button I add a new dataset into the data source and call the servive of the data source. The line chart is refreshing and show my the new value. My own widget do nothing. I add a TW.log.debug("bla") to the this.updateProperty = function (updatePropertyInfo) in my code. In log I see only one-time the "bla" in log. Only after rendering the widget for the first time. The service call will not call the updateProperty function.

What can be wrong? Is something to notes by refresh the data source?

4 REPLIES

Re: Custom widget updateProperty will not called

Hi David,

Just checking you included condition for TargetProperty ==Data property in UpdateProperty method, right ?

And Data property's isBindingTarget is set to true.

If possible share the code by hiding confidential lines of code.

Thanks

Re: Custom widget updateProperty will not called

Did anyone find a solution for this?

 

I have written the updateProperty function but it just doesn't seem to be called. I know this since i have added both TW.log and console.log on the first line of the function code.

 

On further investigation using a debugger, it seems that the value of 'this' in this case the widget object is returned to it's initial state somewhere after the function 'afterRender' is invoked. Hence, the custom code written in 'updateProperty' is never executed.

 

I have created extensions before but this is my first widget. The input type is an infotable as is in the original question. I can share the code if needed, since this is just a trial run at creating widgets. Any help/insight is much appreciated.

Re: Custom widget updateProperty will not called

Just to provide an update:

I upgraded my Thingworx Platform to 8.1 and tried using the same extension created off Thingworx Extension SDK 7.2. It still didn't work.

 

I then upgraded my Extension SDK version to 8.1 and the very same code that i had written in the 7.2 version started working here.

 

I suppose it might be a problem with the Extension SDK 7.2 having a bug. It would be great if one of you guys from PTC could raise an internal ticket and look into this. As i said before i'm willing to share my code from the Extension if needed.

 

Thanks

Re: Custom widget updateProperty will not called

Hi, if this is your case, I would call it a version compatibility problem. The TWX 8.1 has several major upgrades than TWX 7.2, so the TWX extension SDK might also changed (It's quite common that the previous Extensions cannot work in new TWX versions). Since that the Encoder does not match the system, the script it compiles might also fail in the system. That could explain why you can make the script work with the matched TWX Extension SDK. (Usually if there's a new release for the same Extension, it indicates a version problem)