Hi all,
I have been trying to implement a tableview in which the row editor is
called every time a row is selected (no need for a double click).
The code I used is the following:
myTableView.getTableViewSelectionListeners().add(new
TableViewSelectionListener.Adapter() {
@Override
public void selectedRowChanged(TableView tv, Object o) {
int row = tv.getSelectedIndex();
tv.getRowEditor().edit(tv, row, 0);
}
}
);
The code seems to work. Indeed the row editor is called when I move with the
cursor on the row.
However, when I move "too fast", i get the following error:
Duplicate listener org.apache.pivot.wtk.content.tableviewrowedito...@d2f5f1
added to org.apache.pivot.wtk.container$containermouselistenerl...@10c276
java.lang.IllegalArgumentException: Component already has a parent.
at org.apache.pivot.wtk.TablePane$Row.insert(TablePane.java:199)
at org.apache.pivot.wtk.TablePane$Row.add(TablePane.java:187)
at
org.apache.pivot.wtk.content.TableViewRowEditor.open(TableViewRowEditor.java:291)
at org.apache.pivot.wtk.Window.open(Window.java:585)
at
org.apache.pivot.wtk.content.TableViewRowEditor.edit(TableViewRowEditor.java:182)
Any help is appreciated,
Lello
--
View this message in context:
http://apache-pivot-users.399431.n3.nabble.com/TableView-selectedRowChanged-tp1992938p1992938.html
Sent from the Apache Pivot - Users mailing list archive at Nabble.com.