Skip to main content
1-Visitor
August 14, 2020
Question

Widget extension - updateSelection is not working

  • August 14, 2020
  • 1 reply
  • 1161 views

Hi PTC community

 

I'm developing a dropdown widget where i'm testing when you select an option on dropdown, the "selected row(s)"  should be triggered and populate a bounded widget with the options selected:

 

FredSilva92_0-1597422291140.png

 

But i'm using the fun updateSelection as solutionsDropdown.updateSelection('Data', [0]), where solutionsDropdown is my widget and it's not working.

I'm using typescript along with template provided by PTC on github.

Do you have ideias?
Looking forward for your answer,

Thanks a lot.
Frederico Silva

1 reply

5-Regular Member
August 19, 2020

Hello,

 

I am assuming that your custom widget's property name is Data. You should also ensure that the element you return from renderHtml has the widget-content class applied to it.

 

Where in your widget do you invoke updateSelection? Can you verify via the inspector that that section of code does indeed execute?

 

It could be possible that the method containing your call to updateSelection doesn't get invoked at all for some reason or that some other expression throws before that call is made.