Skip to main content
Dec 24, 2021 7:23 AM UTC
Question

How to clear content in Autocomplete widget

Hi,

 

I am using Thingworx 8.5.1 version.  I am trying to clear selected search content. Can any one help me how to clear search content from Autocomplete widget?.

 

Thanks&Regards,

Latha

5 replies

Dec 24, 2021 9:03 AM UTC

 Hi Latha,

 

A similar question was already earlier - "Clear all content in autocomplete widget": https://community.ptc.com/t5/ThingWorx-Developers/Clear-all-content-in-autocomplete-widget/td-p/607094 

vi1Author
Dec 24, 2021 9:45 AM UTC

Hi,

 

Looks like there is no response for similar question.

 

Regards,

Latha

Dec 24, 2021 1:53 PM UTC

@tmisner 

Dec 27, 2021 7:29 AM UTC

Hi Latha,

 

I have checked the possibility of clearing the entered text on button click using auto complete widget .The issue is auto complete widget is designed for holding a set of values and matching the entered content with set of values to show the suggestions .

There is no direct property/event in the widget which can directly clear the entered text. Even there is no possibility of resetting the entered text on button click .There is changedText property which takes the entered text but it’s an outgoing property (->) and so there is no way of setting the text to null on a click .

The only way it will be feasible is to have an incoming property called “ResetToDefaultValue” as we have it in text box .So you can take a reference of text box widget code and try to customize your auto complete widget for adding “ResetToDefaultValue” property .

 

You can customize it as per your need. Kindly check the below attached article:

https://www.ptc.com/en/support/article/CS201191

 

Regards

Bhawna

vi1Author
Dec 27, 2021 8:50 AM UTC

Thank you.

 

I will try to develop custom widget.

 

Regards,

Latha