Detect row editing finish [message #481774] |
Mon, 24 August 2009 09:34 |
Marco Maccaferri Messages: 147 Registered: July 2009 |
Senior Member |
|
|
Hi,
I have a table viewer populated with elements sorted by a date column,
the user needs to be able to edit all cells in a row, including the date
column, without causing a refresh and consequently a reordering of the
rows, but wants that the table to be sorted when it has finished editing
a row.
The first requirement is quite easy since sorting happens only when
calling viewer.refresh, the second requirement seems a bit difficult to
me, so far I haven't found a reliable way to detect when the user has
finished to edit a row.
The problem looks related to what the user means as "finished editing a
row". Basically the user is editing a row when it activates the cell
editors within the same row. Editing is finished when 1) the user clicks
on another row, or 2) clicks the blank space between the last row in the
viewer and the table boundaries, or 3) clicks on a button (for example
to add a new row or go to the next page in a wizard).
Adding a mouse listener to the table seems to work for 1 and 2, but not
for 3 (of course because the click happens outside the table). Adding a
focus listener should work for 3 but prevents the editors to be enabled
because a focusLost event is fired when an editor is activated (the
focus passes from the table to the editor).
Do you have any suggestion on how to accomplish this task ?
Regards,
Marco.
|
|
|
Powered by
FUDForum. Page generated in 0.02842 seconds