Selecting Table Row with Push (Brief Deselection/Reselection)

Hi I have a push enabled app (Streaming) using a table to display data. The table is selectable with a ValueChangeEvent listener. I have a background thread which updates the table in an access() block. When a table row is selected the row becomes selected but then the previously selected row briefly becomes re-selected, then the current row becomes selected again and the ValueChangeEvent fires. I figure this has something to do with the push mechanism but don’t know how to prevent this behavior thanks

Sounds like push has a role there as you said. It is hard to say what goes wrong without looking at the code. Could it be possible that your ValueChangeListener does something that triggers the background thread to reupdate the table?

The scenario could be something like this

  • User clicks a row in browser
  • ValueChangeListener is fired on server and the code within it is run
  • Browser is notified of changes AND a background thread starts doing work on server
  • Background thread updates the value of the table on the server, so far still looks like correct selection in the browser
  • Background thread notifies client of change, selection changes to wrong value, a new ValueChangeEvent is also fired within the server.

That is one hunch that I had. Other one would be some timing issue where both server and client tries to update the table at the same moment and it flashes with changed values while the messages to each other are being processed. That’s one thing that I see now and then with some setups with push and a user that clicks fast in the browser.

I guess best way to find out what is happening is by having break points here and there and see what is going on. At least in ValueChangeListener and in the background thread. Hope this helps, sorry for not being able to provide a direct answer.

Hi thanks for responding. Going to dig in a bit more and see if I can better isolate what’s happening. Will come back with any interesting findings.