Skip to main content



      Home
Home » Eclipse Projects » NatTable » Removing a row affects another row
Removing a row affects another row [message #1772277] Thu, 07 September 2017 08:06 Go to next message
Eclipse UserFriend
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 08:40] by Moderator

Re: Removing a row affects another row [message #1772281 is a reply to message #1772277] Thu, 07 September 2017 09:04 Go to previous messageGo to next message
Eclipse UserFriend
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 17:35 Go to previous messageGo to next message
Eclipse UserFriend
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 01:21 Go to previous messageGo to next message
Eclipse UserFriend
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 15:16 Go to previous message
Eclipse UserFriend
Wow - this did the trick :-) Many thanks!

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


Current Time: Wed Jul 23 14:31:54 EDT 2025

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

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

Back to the top