|Freezing several rows --> Collapse/Expand Root Node --> duplicate rows [message #1470665]
||Wed, 12 November 2014 14:21
| David Schowalter
Registered: November 2014
My NatTable has the following configuration:|
TreeList<CETNode<?>> treeList = new TreeList<CETNode<?>>(tableElements, new TreeNodeFormat(sortModel),expansionModel);
GlazedListTreeData<CETNode<?>> treeData = new TreeNodeTreeData(treeList);
GlazedListsDataProvider<CETNode> bodyDataProvider = new GlazedListsDataProvider(treeList, columnAccessor);
DataLayer bodyDataLayer = new DataLayer(bodyDataProvider);
// Body layer
// layer which handles update events in the model
GlazedListsEventLayer<CETNode<?>> glazedListsEventLayer = new GlazedListsEventLayer<CETNode<?>>(bodyDataLayer, treeNodes);
ColumnHideShowLayer columnHideShowLayer = new ColumnHideShowLayer(glazedListsEventLayer);
SelectionLayer selectionLayer = new SelectionLayer(columnHideShowLayer, null, true, false);
// TODO: this is only a workaround because of a bug in the selection layer when a structural change event
// occurs. If the default Event Handler Implementation is used, the selection layer looses the current selection
// "too often", see http://www.eclipse.org/forums/index.php/t/457074/
TreeLayer treeLayer = new TreeLayer(selectionLayer, new GlazedListTreeRowModel(treeData), new IndentedTreeImagePainter(), true);
ViewportLayer viewportLayer = new ViewportLayer(treeLayer);
FreezeLayer freezeLayer = new FreezeLayer(treeLayer);
CompositeFreezeLayer compositeFreezeLayer = new CompositeFreezeLayer(freezeLayer, viewportLayer,selectionLayer);
There is a Tree implemented in the NatTable as Data Structure. This Tree can be collapsed and expanded just like in the example "TreeStructureGridExample". Now we added a FreezeLayer.
The Problem occurs, when several rows are freezed and the (for example) root node is collapsed. Then, the number of shown rows is smaller than the freezed region and the tree disappears. So the problem seems to be that the viewportLayer can't handle the state, if there are less shown rows than the size of the freezed region.
By debugging in the ViewportEventHandler of the NatTable I could preserve the disappearing by setting the startY variable to 0 before collapsing. This prevents the disappearing of the whole tree.
I implemented a function to expand the whole tree via a button. And after the described scenario (of collapsing the root node with several freezed rows) some rows are duplicated as long as the Freeze is present.
So now there are two question:
How to prevent the Tree to disappear when the rowCount is smaller than the freezed Region size of rows?
How to prevent the Tree to duplicate the elements of the freezed region?
Thanks for your help.
Powered by FUDForum
. Page generated in 0.02499 seconds