javafx 2 - revert TextFieldTableCell value -
i used example 13-10 tableviewsample enabled cell editing in page:
http://docs.oracle.com/javafx/2/ui_controls/table-view.htm
let's see portion:
firstnamecol.setoneditcommit( new eventhandler<celleditevent<person, string>>() { @override public void handle(celleditevent<person, string> t) { ((person) t.gettableview().getitems().get( t.gettableposition().getrow()) ).setfirstname(t.getnewvalue()); } } );
in handle method want catch exception, , when exception occurs cell text must reverted old value. can not change text, when call
((person) t.gettableview().getitems().get( t.gettableposition().getrow()) ).setfirstname(t.getoldvalue());
just changes value of tableview data, not displayed text
Comments
Post a Comment