Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » NatTable » Removing a row affects another row
Removing a row affects another row [message #1772277] Thu, 07 September 2017 12:06 Go to next message
Ralf Heydenreich is currently offline Ralf HeydenreichFriend
Messages: 235
Registered: July 2009
Senior Member
Hi all,
I've built a NatTable where you can remove a selected row. If I select a complete row (clicking on row header), the row is removed correctly after pressing the delete button. But if I select a cell (edit mode) and then fire the delete button only the last row in my table is removed. I figured out that it has to do with the UpdateDataCommandHandler, which updates all rows by changing an entry in the data layer but I can't find out the mistake. I'm using ListDataProvider as data provider. Any suggestions how to fix it?

[EDIT]
An idea to solve this problem is to exit the editing mode if I click on the delete button. But I don't know how I can do this.

Thanks,
Ralf.

[Updated on: Thu, 07 September 2017 12:40]

Report message to a moderator

Re: Removing a row affects another row [message #1772281 is a reply to message #1772277] Thu, 07 September 2017 13:04 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2902
Registered: July 2012
Senior Member
Well if an editor is active you need to close it to avoid a commit. Not sure how you implemented the deletion of a row, but that should be done in advance if the commit has such an effect in your table.
Re: Removing a row affects another row [message #1772311 is a reply to message #1772281] Thu, 07 September 2017 21:35 Go to previous messageGo to next message
Ralf Heydenreich is currently offline Ralf HeydenreichFriend
Messages: 235
Registered: July 2009
Senior Member
Hi Dirk,
I agree with you, but I don't know how I can cancel the editing mode programmatically. Is there any command or other solution?

Regards,
Ralf.
Re: Removing a row affects another row [message #1772318 is a reply to message #1772311] Fri, 08 September 2017 05:21 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2902
Registered: July 2012
Senior Member
natTable.getActiveCellEditor().close();


But of course that call is not null safe and NatTable#getActiveCellEditor() can return null if there is no editor active.
Re: Removing a row affects another row [message #1772410 is a reply to message #1772318] Fri, 08 September 2017 19:16 Go to previous message
Ralf Heydenreich is currently offline Ralf HeydenreichFriend
Messages: 235
Registered: July 2009
Senior Member
Wow - this did the trick :-) Many thanks!

Ralf.
Previous Topic:NatTable: Remove Gridline from cell
Next Topic:Custom ComboBoxCellEditor
Goto Forum:
  


Current Time: Tue Apr 16 15:46:07 GMT 2024

Powered by FUDForum. Page generated in 0.15435 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top