I have a graphical interface that issues commands to the web server based on the values of the slider. Some of these sliders are “connected” to the web server, so changing one of them can also change the other. Communication is performed by the web server, returning a list of values that were set based on the issued command.
Thus, I can easily install the appropriate sliders based on this answer, but the problem is that it causes ChangeListener to start and then be issued to the web server again. Ideally, the “clutch” should behave well and avoid endless loops, but this is a potential problem, and sending all these extra events seems unnecessary.
Two solutions I could think of were:
- Temporarily remove listeners, change the value, and then return them.
- Add a “manual” flag to let the listener know that he should ignore the change.
None of them seem like the perfect solution for me, but is one of them “better” than the other? Or is there a third solution that I am not considering?
source share