i wondering if commitedit() method of tablecell in javafx updates property of object row represents.
from tableview
documentation:
by default
tablecolumn
edit commit handler non-null, default handler attempts overwrite property value item in currently-being-edited row. ablecell.commitedit(object)
method passed in new value, , passed along edit commit handler viacelleditevent
fired. matter of callingtablecolumn.celleditevent.getnewvalue()
retrieve value.it important note if call
tablecolumn.setoneditcommit(javafx.event.eventhandler)
owneventhandler
, removing default handler. unless handle writeback property (or relevant data source), nothing happen. can work around usingtablecolumnbase.addeventhandler(javafx.event.eventtype, javafx.event.eventhandler)
method addtablecolumn.edit_commit_event
eventtype desiredeventhandler
second argument. using method, not replace default implementation, notified when edit commit has occurred.
so default, calling commitedit(...)
cause tablecolumn
attempt update value represented cell. if set event handler calling tablecolumn.setoneditcommit(...)
, remove default behavior.
note default mechanism works casting object returned column's cellvaluefactory
writablevalue
, , calling setvalue()
method. (essentially) work if backing model table uses javafx properties pattern. in other words, should have equivalent to
column.setcellvaluefactory(celldata -> celldata.getvalue().xxxproperty());
where xxxproperty()
method in model table returns implementation of writablevalue
(e.g. property
object).
Comments
Post a Comment