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

Community Tip - Did you get an answer that solved your problem? Please mark it as an Accepted Solution so others with the same problem can find the answer easily. X

Reset DropDown on WindowClosed of Navigation Function

AndyHilton
12-Amethyst

Reset DropDown on WindowClosed of Navigation Function

I have the following elements in this scenario running Thingworx 8.5.18:

1. DropDown widget - Used to select a URL(output)

2. Service(infotable output) - feeds the list of items to the DropDown widget above

3. Navigation Function - Takes the output of the DropDown widget and feeds it to a target mashup as a popup.

 

DropDown widget:

AndyHilton_0-1655235684098.png

Service (populates the DropDown widget from a infotable with a Report(shown in DropDown widget) row and a URL(passed to the popup target Mashup) row):

AndyHilton_1-1655235878820.png

Navigation Function

AndyHilton_2-1655235968295.png

 

What currently happens - When I close the popup that is generated from the selection of an item in the DropDown the DropDown still shows the item I selected.  This is an issue because the DropDown doesn't allow me to reselect that item without selecting another item first.

What I need to have happen - When I close the popup that is generated from the selection of an item in the DropDown I need the list in the DropDown to be reset to its default load state. ie "Select Report..."

 

What I've tried - I've tried using another service to pass a null string(result = "";) into the DropDown on the WindowClosed event of the Navigation popup Function.  This causes another popup to be opened which is blank because I have the Navigate event tied to the SeletedRowsChanged event of my primary service.

1 ACCEPTED SOLUTION

Accepted Solutions
slangley
23-Emerald II
(To:AndyHilton)

Hi @AndyHilton.

 

We tested on 9.3.2, and were able to achieve this by binding the PopupCancelled event trigger on the Navigation function to ResetToDefault Value on the drop-down widget.  In our test, we had an empty string for the first row and it reset to that each time.  You may have to play around with it if you wish it to default to something different.

 

There are other event triggers that you may also want to bind, such as PopupDone and PopupBlocked in order to cover all scenarios.

 

Regards.

 

--Sharon

View solution in original post

8 REPLIES 8

while I do not have a 8.5.18 instance at hand, I can suggest the following:

1. Doesn't your dropdown widget have any service like "Reset to Default"?

2. Can't you use a Validator as a way to trigger the navigation only if the selected item is not null?

1. I tried a "Reset" service but every time I it ran a new popup would be generated because the navigate of the popup was tied to "SelectedRowsChanged" of the service that populated the dropdown list.
2. I've looked into this option but I'm not sure how to implement.  When I draw out the logic it seem circular.  Any help on this option would be appreciated.

knagata
14-Alexandrite
(To:AndyHilton)

Hi, I have tested it on ThingWorx 9.3.

From Navigate function, selected >Configure Bindings, bind "PopupCanceled" event to DropDown "ResetToDefaultValue". After that, when I close the popup, the DropDown is reset to its default load state.

AndyHilton
12-Amethyst
(To:knagata)

Unfortunately that option isn't available in the Navigate Function for 8.5.  Is there a way for me to backport the Navigate Function from 9.3 to 8.5 as an option?  We've tried upgrading to 9.3 from 8.5 but it fails every time so we are kind of stuck at this point.

VP_10348089
5-Regular Member
(To:AndyHilton)

Hi,

 

   You can try by setting selected text  for dropdown as "Select Report.."  on popup closing. 

AndyHilton
12-Amethyst
(To:knagata)

I've upgraded to 9.3.3 but that solution doesn't seem to work.  Maybe I have my dropdown setup wrong?  Can you share how you have your dropdown configured?  Thank you!

Send empty infotable to "SelectedItems". This removes the previously selected item.

 

https://www.ptc.com/en/support/article/CS288500 Please check here its working fine for me.

slangley
23-Emerald II
(To:AndyHilton)

Hi @AndyHilton.

 

We tested on 9.3.2, and were able to achieve this by binding the PopupCancelled event trigger on the Navigation function to ResetToDefault Value on the drop-down widget.  In our test, we had an empty string for the first row and it reset to that each time.  You may have to play around with it if you wish it to default to something different.

 

There are other event triggers that you may also want to bind, such as PopupDone and PopupBlocked in order to cover all scenarios.

 

Regards.

 

--Sharon

Top Tags