Gender: Male
Location: Oregon
Registered: Jan 2012
Status: Offline
Posts: 1
Posted Friday, January 20, 2012 @ 13:17:00
I'm probably doing something wrong, but upon initial population of a table, I see the first row is selected by default. I would expect that to generate an afterRowSelectionChange event
Code:
public class MyTableEventListener extends DBTableEventListener {
public void afterRowSelectionChange(int fromRow, int toRow) {
System.out.println("Selected index="+toRow);
}
}
But it does not appear to do that. Now if I also attach a listener to the data model via:
I do see the initial selection, but the data model listener seems very flaky and doesn't always report the row I am currently on. I'm not sure why as I'm new to Java and again it is probably something I am doing wrong.
Anyway, the above code for the DBTableEventListener appears to report all of my row selections properly, I just expected to receive an event when the first row is selected. I also tried to remove any default row selection, but was unable to figure out how to do that either, other than turning off row selection all together.
I think this event is fired only when user changes the rows, not during refresh(). Again I might be wrong. A workaround would be to call rowselectionevent handler manually after refresh(). Source code is now open source, you can checkout.
In order to fully utilize the abilities of this board, you are required to register as a member. Registration is free, and allows you to do lots of things including turning on or off certain features of this board. Register now!