Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » NatTable » Columns are not editable
Columns are not editable [message #1727341] Tue, 22 March 2016 09:43 Go to next message
Rashmi Tr is currently offline Rashmi TrFriend
Messages: 22
Registered: November 2011
Junior Member
In my Nattable, there is SpanningDataLayer and on top of that ColumnHideShowLayer,SelectionLayer,ViewportLayer,FreezeLayer,CompositeFreezeLayer.
Then I add labels to Columns which should be editable and I extended AbstractRegistryConfiguration as explained in Nattable Documentation.

configRegistry.registerConfigAttribute(EditConfigAttributes.CELL_EDITABLE_RULE, IEditableRule.ALWAYS_EDITABLE,
columnLabels_editable);

configRegistry.registerConfigAttribute(EditConfigAttributes.CELL_EDITOR,new TextCellEditor(true, true),
DisplayMode.NORMAL, columnLabels_column1);

ComboBoxCellEditor comboBoxCellEditor = new ComboBoxCellEditor(values, -1);
comboBoxCellEditor.setFreeEdit(true);
configRegistry.registerConfigAttribute(EditConfigAttributes.CELL_EDITOR, comboBoxCellEditor, DisplayMode.EDIT,
columnLabels_column2);
configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_PAINTER,
new CustomLineBorderDecorator(new ComboBoxPainter(),
new BorderStyle(1, GUIHelper.COLOR_BLUE, LineStyleEnum.SOLID)),
DisplayMode.NORMAL, columnLabels_column2);

I added this to nattable configuration. But the Columns are still not editable.What could be the reason?
Re: Columns are not editable [message #1727358 is a reply to message #1727341] Tue, 22 March 2016 12:09 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2902
Registered: July 2012
Senior Member
I suppose you are missing the required editing configurations in your NatTable. It doesn't look like you are using a GridLayer, therefore you need to add those to your composition yourself. That is also explained in the documentation.
Re: Columns are not editable [message #1727450 is a reply to message #1727358] Wed, 23 March 2016 08:41 Go to previous messageGo to next message
Rashmi Tr is currently offline Rashmi TrFriend
Messages: 22
Registered: November 2011
Junior Member
Hi Dirk,
Thanks for your Reply. Ja I am using CompositeLayer not GridLayer . Now I added Editconfiguration and Edit bindings in Composite Layer

CompositeLayer compositeLayer = new CompositeLayer(1, 2);
compositeLayer.setChildLayer(GridRegion.COLUMN_HEADER, columnGroupHeaderLayer, 0, 0);
compositeLayer.setChildLayer(GridRegion.BODY, compositeFreezeLayer, 0, 1);

// add edit configurations
compositeLayer.addConfiguration(new DefaultEditConfiguration());
compositeLayer.addConfiguration(new DefaultEditBindings());

Still I am not getting the Result.
Re: Columns are not editable [message #1727470 is a reply to message #1727450] Wed, 23 March 2016 09:50 Go to previous message
Rashmi Tr is currently offline Rashmi TrFriend
Messages: 22
Registered: November 2011
Junior Member
Hi Dirk,
it is working.
Thanks,
Rashmi
Previous Topic:Nattable elements are sorted after applying the filter
Next Topic:Resize one column when selected all rows
Goto Forum:
  


Current Time: Thu Apr 25 04:27:06 GMT 2024

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

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

Back to the top