Hi everyone,
I have a DataTable with several entries. When I click an entry, a service runs and loads the images from the imagePath stored in that entry. Everything works fine normally — the Collection widget displays the correct images.
However, when I switch between entries very very fast, sometimes the images from a previous entry stay visible and do not update, even though the selected entry has changed. It looks like the Collection widget doesn’t refresh properly when service calls overlap or happen too quickly.
Has anyone experienced this behavior or found a reliable way to force-refresh the Collection widget when rapidly changing entries?
Thanks,
Jamal
Solved! Go to Solution.
Hi @MA8731174
You're running an old, unsupported release, so it's difficult to provide support on this, but this issue can arise due to overlapping service calls that do not complete in the expected order. Here are some possible strategies for resolving the issue:
Force Refresh: After changing the selected entry, explicitly trigger a refresh of the Collection widget. This can be done by calling a refresh function or reloading the data source associated with the widget.
Debounce Input: Introduce a debounce mechanism that limits how quickly the entry selection can change. This can help prevent multiple rapid service calls from overlapping and ensure that the widget has time to update.
Loading Indicators: Use loading indicators to signal when data is being fetched. This can help manage user expectations and prevent them from switching entries too quickly.
Service Call Management: Ensure that service calls are managed effectively. You might want to cancel any ongoing service calls when a new entry is selected, or implement logic to handle the responses in the order they were initiated.
Regards.
--Sharon
Hi @MA8731174
Which version of ThingWorx are you running? There have been several changes to the Collection widget over the years. Also, do you see the same behavior across different browsers?
Regards.
--Sharon
Hi, Thingworx version 9.3.7
Hi @MA8731174
If you feel your question has been answered, please mark the appropriate response as the Accepted Solution. If you still need assistance, please provide further details of your scenario.
Regards.
--Sharon
Hi @MA8731174
You're running an old, unsupported release, so it's difficult to provide support on this, but this issue can arise due to overlapping service calls that do not complete in the expected order. Here are some possible strategies for resolving the issue:
Force Refresh: After changing the selected entry, explicitly trigger a refresh of the Collection widget. This can be done by calling a refresh function or reloading the data source associated with the widget.
Debounce Input: Introduce a debounce mechanism that limits how quickly the entry selection can change. This can help prevent multiple rapid service calls from overlapping and ensure that the widget has time to update.
Loading Indicators: Use loading indicators to signal when data is being fetched. This can help manage user expectations and prevent them from switching entries too quickly.
Service Call Management: Ensure that service calls are managed effectively. You might want to cancel any ongoing service calls when a new entry is selected, or implement logic to handle the responses in the order they were initiated.
Regards.
--Sharon
