event listener increments output

Hi guys,

I have a dynamic table which listen to a combobox listener. each time I change the value from my combobox it fires an event that changes the data in my table. my table also has a listener for each row which popup a subwindow each time I click a specific column. my problem is that, it increments the popup subwindow each time I change the value from my combobox. lt will popup 1 subwindow at first, then 2 subwindows, then 3 subwindows and so on.

here’s the screenshot:


fnc

the problem is a bit similar with the one I solved previously using remove listener, but this time, I cant use the remove listener from my table since it will affect other rows as well. What would be the solution for this?

Hi,

It sounds like you’re on the right track. The problem is most probably due to not removing the listeners correctly, causing there to be more than one listener that is triggered whenever you change a value in your combobox.

You need to redesign your code to either keep track of the listeners (store a reference to them) so that you can remove them before changing the contents of the table or register the listeners only once and dig up the correct data to display somehow (depending on your app) in the listener code.

If you already dig up what to show in the window when the column is clicked you should not have to do anything other than make sure that the listener is added only once.

HTH,
/Jonatan

Thanks Jonatan… :grin: