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

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -