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

Custom widget properties for default widgets like Shape widget

Highlighted
Contributor

Custom widget properties for default widgets like Shape widget

I want to to create a tooltip property for the shape widget which is available by default. I have changed the shape.ide.js and shape.runtime.js files available in Tomcat\webapps\Thingworx\Common\thingworx\widgets\shape with as attached. In shape.ide.js I have added 'supportsTooltip': true and Properties: 'ToolTipField': {
'description': TW.IDE.I18NController.translate('tw.button-ide.properties.label.description'),
'defaultValue': TW.IDE.I18NController.translate('tw.button-ide.properties.label.default-value'),
'baseType': 'STRING',
"isBindingTarget": true,
'isLocalizable': true
},

In shape.runtime.js I have added if (updatePropertyInfo.TargetProperty === 'ToolTipField') {
thisWidget.setProperty('ToolTipField', updatePropertyInfo.SinglePropertyValue);
} in updateProperty().

But my Shape widget is not showing Tooltip in the properties section of the widget when I put it in a mashup. Where am I getting wrong ?

 

3 REPLIES 3

Re: Custom widget properties for default widgets like Shape widget

Have you compared with other widgets that do have a tooltip ? Also, any errors in the application log or in the  browser dev tools console?

Re: Custom widget properties for default widgets like Shape widget

I believe that it will not work like that.

 

Tthe better way would be to create your own widget based on the Shape Widget, and import it direcetly to ThingWorx as a new one.

 

 

Re: Custom widget properties for default widgets like Shape widget

Hi @soumya-hcl.

 

If one of the previous responses provided a solution, please mark it as the Accepted Solution for the benefit of others who may have the same question.

 

Regards.

 

--Sharon