I have two tables which i would like to scroll synchronously.
I am using pturmel’s example (Freeze table column), and everything is working fine.
But I would like add some point to stop that ChangeListener and break synchronous scrolling two tables. Not sure how to do this. There is removeChangeListener() but i did not figure out how to use it.
Also, where can be found some details regarding viewport, especially for Table Component (table.viewport)?
You have to pass the listener you want to remove to the removeChangeListener() method. Which means you need to save it somewhere persistent. A client property of the component is probably the best place.
I tried client property. I added myScrollEvent to Button_1, and save it as myClientProperty_1, and then use another Button_2, get myClentProperty_1, print myScrollProperty_1 (<function myScrollEvent at 0x2>), but when i try to remove change listener “tblT22.viewport.removeChangeListener(myScrollEvent)”, nothing happens. Change listener is still active and both table are still scroll synchronously.
What i am doing wrong?
Ah, I think you’ll actually have to subclass the ChangeListener interface. I think that happens under the hood if you just add a callable, so the callable isn’t really the ChangeListener. If you subclass it, jython shouldn’t transform it automagically.