Skip to main content



      Home
Home » Eclipse Projects » NatTable » Vertical scroll bar is appearing when filter applied wrt base list with empty rows
Vertical scroll bar is appearing when filter applied wrt base list with empty rows [message #1855948] Thu, 10 November 2022 16:20 Go to next message
Eclipse UserFriend
Hi,

When i apply filter in Nattable, Vertical Scroll bar is appearing with respect to base list with empty rows. Please find my SWT composite creation below and please find the attachments.

// create nattable
parent.setLayout(new GridLayout());
natTable = new NatTable(parent, compositeLayer, false);

natTable.configure();
GridDataFactory.fillDefaults().grab(true, true).applyTo(natTable);

I checked the nattable GlazzedListFilter example, there it is working perfectly.

So, could you please guide me if I am doing wrong or anything missing to resolve this issue.

Thank you in Advance.


Re: Vertical scroll bar is appearing when filter applied wrt base list with empty rows [message #1855950 is a reply to message #1855948] Fri, 11 November 2022 00:26 Go to previous messageGo to next message
Eclipse UserFriend
It doesn't seem to be a SWT layout issue. It actually seems to be an issue in your NatTable composition as it looks like there are empty rows. Is the scrollbar from NatTable or is it from the surrounding Composite? What are those empty rows?
Re: Vertical scroll bar is appearing when filter applied wrt base list with empty rows [message #1855952 is a reply to message #1855950] Fri, 11 November 2022 02:15 Go to previous messageGo to next message
Eclipse UserFriend
Assume that there are 5 rows initially without filter. Then everything looks good.
Once i apply filter, then 2 rows filtered out, and the remaining 3 rows which are not filtered as empty rows appearing with vertical scroll bar.
Re: Vertical scroll bar is appearing when filter applied wrt base list with empty rows [message #1855953 is a reply to message #1855952] Fri, 11 November 2022 02:53 Go to previous messageGo to next message
Eclipse UserFriend
Sorry but you are not providing any meaningful information to help leverage the problem. If you see empty rows although you have filtered you probably are mixing the usage of the base list and the usage of the FilterList. If you use the FilterList you need to use that everywhere as the topmost list for reference. If you mix you get strange behaviors like the one you mention.

Please note, if you only provide information like "it does not work, tell me why, but I don't tell you in detail what I am doing" nobody in the world will ever be able to help you!

Also note, if you need professional support, I offer consulting services.
Re: Vertical scroll bar is appearing when filter applied wrt base list with empty rows [message #1855957 is a reply to message #1855953] Fri, 11 November 2022 10:14 Go to previous message
Eclipse UserFriend
Hi Dirk,

Sorry for not providing the sufficient information. As you mentioned i am passing everywhere the filterlist only. Now i found the reason.

If I define columnGroupExpandCollapseLayer and rowGroupExpandCollapseLayer before glazedListsEventLayer, then i am getting these empty rows.

After looking some nattable exmaples and defined these layers after glazedListsEventLayer, then its working fine.

Thank you for your response and support.

Please find below my bodylayerstack class:

class BodyLayerStack extends AbstractLayerTransform {
private final FilterList<TableLine> filterList;
private final ListDataProvider<TableLine> bodyDataProvider;
private final SelectionLayer selectionLayer;
private final ViewportLayer viewportLayer;
private final DataLayer bodyDataLayer;
private final IColumnPropertyAccessor columnPropertyAccessor;
private final SortedList<TableLine> sortedList;
private ColumnGroupExpandCollapseLayer columnGroupExpandCollapseLayer;
private ColumnGroupModel columnGroupModel;
private RowGroupExpandCollapseLayer rowGroupExpandCollapseLayer;

public BodyLayerStack(List<TableLine> values, List<String> finalRows, IColumnPropertyAccessor columnPropertyAccessor, ConfigRegistry configRegistry) {
this.columnPropertyAccessor = columnPropertyAccessor;
EventList eventList = GlazedLists.eventList(values);
TransformedList rowObjectsGlazedList = GlazedLists.threadSafeList(eventList);

sortedList = new SortedList<TableLine>(rowObjectsGlazedList, null);
this.filterList = new FilterList<TableLine>(sortedList);

this.bodyDataProvider = new ListDataProvider<TableLine>(this.filterList, this.columnPropertyAccessor);


bodyDataLayer = new DataLayer(getBodyDataProvider());

bodyDataLayer.setConfigLabelAccumulator(new ColumnLabelAccumulator());


HoverLayer hoverLayer = new HoverLayer(bodyDataLayer, true);
hoverLayer.addConfiguration(new SimpleHoverStylingBindings(hoverLayer));

// layer for event handling of GlazedLists and PropertyChanges
GlazedListsEventLayer glazedListsEventLayer = new GlazedListsEventLayer<>(hoverLayer, this.filterList);

columnGroupExpandCollapseLayer = new ColumnGroupExpandCollapseLayer(glazedListsEventLayer);

rowGroupExpandCollapseLayer = new RowGroupExpandCollapseLayer(columnGroupExpandCollapseLayer);

this.selectionLayer = new SelectionLayer(rowGroupExpandCollapseLayer);
viewportLayer = new ViewportLayer(getSelectionLayer());

setUnderlyingLayer(viewportLayer);
}


public SortedList<TableLine> getSortedList() {
return sortedList;
}


public SelectionLayer getSelectionLayer() {
return this.selectionLayer;
}


public FilterList<TableLine> getFilterList() {
return this.filterList;
}


public ListDataProvider<TableLine> getBodyDataProvider() {
return this.bodyDataProvider;
}


public ViewportLayer getViewportLayer() {
return this.viewportLayer;
}


public IColumnPropertyAccessor getColumnPropertyAccessor() {
return this.columnPropertyAccessor;
}


public DataLayer getBodyDataLayer() {
return this.bodyDataLayer;
}


public ColumnGroupExpandCollapseLayer getColumnGroupExpandCollapseLayer() {
return columnGroupExpandCollapseLayer;
}
}
Previous Topic:How to update row group header while filtering
Next Topic: java.lang.IllegalStateException: Could not find any implementations of MutableSetFactory
Goto Forum:
  


Current Time: Thu May 15 16:51:32 EDT 2025

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

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

Back to the top