Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » NatTable » NatTable data refresh issue on Horizontal and Vertical Scroll(NatTable data refresh issue on Horizontal and Vertical Scroll)
NatTable data refresh issue on Horizontal and Vertical Scroll [message #1748014] Thu, 17 November 2016 18:50 Go to next message
Shwetha Venkatesh is currently offline Shwetha VenkateshFriend
Messages: 15
Registered: March 2016
Junior Member
I am using NatTable1.4 on FormEditor and it works really well for small size data which doesn't require a scroll. All the rows are loaded successfully for 32 columns.

However, when I have more than 100 rows of data and scrollbar appears, and I use vertical scroll , data is not loaded/refreshed in the table. All the column values appear empty. Similar issue persist with horizontal scroll. I am testing NatTable1.4 on Win 7 machine. With what I understand, data is available but redrawing is taking time. Is there any way to improve the response time to scroll?

Appreciate if any one can share a solution or are facing the same issue.

Thank you.
Re: NatTable data refresh issue on Horizontal and Vertical Scroll [message #1748016 is a reply to message #1748014] Thu, 17 November 2016 18:56 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2614
Registered: July 2012
Senior Member
I heard of issues with huge data sets, especially for a huge amount of columns. But never for such a small amount of data. In such cases typically the data provider you are using needs a long time to calculate the data to show. Without additional information I can't tell anything.
Re: NatTable data refresh issue on Horizontal and Vertical Scroll [message #1748030 is a reply to message #1748016] Thu, 17 November 2016 21:31 Go to previous messageGo to next message
Shwetha Venkatesh is currently offline Shwetha VenkateshFriend
Messages: 15
Registered: March 2016
Junior Member
Here is the snippet below , I am using the below snippet from FullFeatureBodyLayerStack from Examples plugin.

//FullFeatureBodyLayerStack.java
IColumnPropertyAccessor<T> columnPropertyAccessor = new ReflectiveColumnPropertyAccessor<T>(
                propertyNames);
this.bodyDataProvider = new ListDataProvider<T>(dataList, columnPropertyAccessor);
this.bodyDataLayer = new DataLayer(this.bodyDataProvider);
this.glazedListsEventLayer = new GlazedListsEventLayer<T>(this.bodyDataLayer,
                eventList);
this.blinkingLayer = new BlinkLayer<T>(this.glazedListsEventLayer,
this.bodyDataProvider, rowIdAccessor, columnPropertyAccessor, configRegistry);

//FormPage.java -> createFormContent()
// Row header
		final DefaultRowHeaderDataProvider rowHeaderDataProvider = new DefaultRowHeaderDataProvider(
				this.bodyDataProvider);
		DefaultRowHeaderDataLayer rowHeaderDataLayer = new DefaultRowHeaderDataLayer(rowHeaderDataProvider);
		rowHeaderDataLayer.setDefaultColumnWidth(50);
		ILayer rowHeaderLayer = new RowHeaderLayer(rowHeaderDataLayer, bodyLayer, bodyLayer.getSelectionLayer());

		// Corner
		final DefaultCornerDataProvider cornerDataProvider = new DefaultCornerDataProvider(
				columnHeaderLayer.getColumnHeaderDataProvider(), rowHeaderDataProvider);
		DataLayer cornerDataLayer = new DataLayer(cornerDataProvider);
		ILayer cornerLayer = new CornerLayer(cornerDataLayer, rowHeaderLayer, columnHeaderLayer);

		// Grid
		GridLayer gridLayer = new GridLayer(bodyLayer, columnHeaderLayer, rowHeaderLayer, cornerLayer);

		IConfigLabelAccumulator cellLabelAccumulator = getConfigLabelAccumulator(listOfPlans, bodyLayer);
		bodyLayer.setConfigLabelAccumulator(cellLabelAccumulator);

		this.natTable = new NatTable(parent, gridLayer, false);


DataList is a List of Objects from my pojo model.
Appreciate if you could let me know what is it going wrong here.

Thank you very much for the inputs.
Re: NatTable data refresh issue on Horizontal and Vertical Scroll [message #1748032 is a reply to message #1748030] Thu, 17 November 2016 21:45 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2614
Registered: July 2012
Senior Member
And what is your IConfigLabelAccumulator doing? Does it perform some time consuming tasks to calculate the labels? That would be also a reason for a slow rendering.
Re: NatTable data refresh issue on Horizontal and Vertical Scroll [message #1786540 is a reply to message #1748032] Mon, 07 May 2018 01:52 Go to previous messageGo to next message
K Kumar is currently offline K KumarFriend
Messages: 38
Registered: March 2011
Member
Hi Dirk, thanks for suggesting on possibility of label accumulator causing the slowness. We are facing similar issue.

My question is, if we are refreshing nattable on a datasource with million rows, does it accumulate labels on all of them or only on rows that needs to be rendered in the viewport?
Re: NatTable data refresh issue on Horizontal and Vertical Scroll [message #1786541 is a reply to message #1786540] Mon, 07 May 2018 03:38 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2614
Registered: July 2012
Senior Member
Only the viewport, that is one of the basic concepts of NatTable.
Re: NatTable data refresh issue on Horizontal and Vertical Scroll [message #1786542 is a reply to message #1786541] Mon, 07 May 2018 04:17 Go to previous messageGo to next message
K Kumar is currently offline K KumarFriend
Messages: 38
Registered: March 2011
Member
Thank you for confirming. Considering this, when we add million rows and do nattable.refresh(true), it is taking really long time to become response. If we do refresh(false), newly added records not being visible.

Is there a efficient way to add lots of new records to underlying datalayer list?
Re: NatTable data refresh issue on Horizontal and Vertical Scroll [message #1786543 is a reply to message #1786542] Mon, 07 May 2018 05:21 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2614
Registered: July 2012
Senior Member
You haven't said anything about how you add the data to the underlying list. I repeat, typically there is no performance issue with adding data and calling refresh(true). That simply means to fire a structural refresh event which triggers refreshing caches and repainting. Since you did not completely post the body layer stack and did not say anything about how you add data, I can't say anything.

As I said before, typically the custom label accumulators are the problem when they iterate over the data. Maybe it is a bug in 1.4 that has been fixed with 1.5 or the 1.6 development state already.
Re: NatTable data refresh issue on Horizontal and Vertical Scroll [message #1786544 is a reply to message #1786543] Mon, 07 May 2018 05:35 Go to previous messageGo to next message
K Kumar is currently offline K KumarFriend
Messages: 38
Registered: March 2011
Member
We add data to underlaying list using .add and .addAll and the body layer stack file is attached.

Each time we add a record to underlaying data list, we used to do refresh(true). Unfortunately it used to take lot of time to as number of records grow. As you alluded, may be our body layer stack may be the reason.

After searching around, we changed the refresh(true) call to showAllRows (below) and it seemed to be performing better than refresh (not sure if this is optimal or functional)

    public void showAllRows() {
        bodyLayer.getRowHideShowLayer()
                .showAllRows();
    }
Re: NatTable data refresh issue on Horizontal and Vertical Scroll [message #1786545 is a reply to message #1786544] Mon, 07 May 2018 06:01 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2614
Registered: July 2012
Senior Member
So there is no GlazedListsEventLayer now? Your posts are confusing!

If the call in RowHideShowLayer does not bring up the performance issue I would assume that there is a performance leak in the RowReorderLayer. Maybe you are facing https://bugs.eclipse.org/bugs/show_bug.cgi?id=509685 which is fixed with 1.5
Re: NatTable data refresh issue on Horizontal and Vertical Scroll [message #1786574 is a reply to message #1786545] Mon, 07 May 2018 15:25 Go to previous message
K Kumar is currently offline K KumarFriend
Messages: 38
Registered: March 2011
Member
Thank you, will take a look and update.
Previous Topic:Possible Bug in CompositeFreezeLayer
Next Topic:How to make nattable fill window horizontally
Goto Forum:
  


Current Time: Tue Sep 18 19:29:32 GMT 2018

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

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

Back to the top