Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » NatTable » Row selection Slow down in case of large data in NatTable(In case of Large data in NatTable, to select last row its takes 5 sec)
Row selection Slow down in case of large data in NatTable [message #1413385] Thu, 28 August 2014 12:02 Go to next message
Chetana Barhate is currently offline Chetana BarhateFriend
Messages: 18
Registered: February 2014
Junior Member
Hi All,

We have migrated the JTable in to Nattable in our RCP application. All functionalities are working fine with NatTable but we are facing some problem related to Performance. In case of large data (around 10000 record), To select last row it takes around 4 to 5 sec. Loading the table is not taking time. If we try to select first row it takes milliseconds and if we scroll down to last row and try to select then its takes 5 seconds. Also to open the context menu it takes 4 to 5 sec.

Please help us for the above issue.
Thanks in advance.
Re: Row selection Slow down in case of large data in NatTable [message #1413453 is a reply to message #1413385] Thu, 28 August 2014 14:52 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2902
Registered: July 2012
Senior Member
That depends on your layer composition. Which layers are involved? If you check our examples and try the same in the "Everything but the kitchen sink" example, you will see that there is no such delay.

IIRC if you are using GlazedLists you should consider to use the GlazedListsDataProvider, as it has a special handling for the last row. Not sure if this is solving your issue.
icon10.gif  Re: Row selection Slow down in case of large data in NatTable [message #1415171 is a reply to message #1413385] Tue, 02 September 2014 08:44 Go to previous messageGo to next message
Chetana Barhate is currently offline Chetana BarhateFriend
Messages: 18
Registered: February 2014
Junior Member
Thanks for the reply.

I tried with GlazedListsDataProvider, but no success. Sad

One more think i observed that if we run the application from eclipse IDE then no problem while selecting the row but if we create a product and run it then it will take time for row seletcion. We have checked the VM arguments in both cases and they are same.
Re: Row selection Slow down in case of large data in NatTable [message #1415175 is a reply to message #1415171] Tue, 02 September 2014 08:52 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2902
Registered: July 2012
Senior Member
10.000 records is not a big deal for NatTable. I don't think it is related to our code, as otherwise it would have been reported already by people that are loading a lot more records.

As I don't know anything about what you are doing, I think I can't help. The typical questions are:
- which version of NatTable?
- which layer composition?
- any specific selection handling involved?

and so on ...
Re: Row selection Slow down in case of large data in NatTable [message #1416147 is a reply to message #1415175] Thu, 04 September 2014 12:33 Go to previous messageGo to next message
Chetana Barhate is currently offline Chetana BarhateFriend
Messages: 18
Registered: February 2014
Junior Member
We have removed all the special handling of selection from our project but still facing the same problem.
One thing we observed that if we remove the RowSelectionModel from the code, then the problem is resolved. The RowSelectionModel code is as follow:

protected RowSelectionModel addSelectionModel(SelectionLayer selectionLayer, ListDataProvider data)
{
RowSelectionModel selMod = new RowSelectionModel (selectionLayer, data, new IRowIdAccessor<QueryResultTo>() {
@Override
public Serializable getRowId(QueryResultTo arg0) {
return arg0.getJobId();
}
});
selMod.setMultipleSelectionAllowed(true);
selectionLayer.setSelectionModel(selMod);
selectionLayer.addConfiguration(new RowOnlySelectionConfiguration());
return selMod;
}

But we required the row selection and not a cell selection for table.
Please suggest.
Re: Row selection Slow down in case of large data in NatTable [message #1416160 is a reply to message #1416147] Thu, 04 September 2014 13:07 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2902
Registered: July 2012
Senior Member
I added your code to the _900_Everything_but_the_kitchen_sink example. I can see a small delay, but definitely nothing about 5 seconds. And that example shows > 50.000 list entries.

As you haven't answered any of my questions I can't help you.
Re: Row selection Slow down in case of large data in NatTable [message #1416168 is a reply to message #1416160] Thu, 04 September 2014 13:23 Go to previous messageGo to next message
Chetana Barhate is currently offline Chetana BarhateFriend
Messages: 18
Registered: February 2014
Junior Member
Sorry for not answering your questions.

-Version of Nattable:
org.eclipse.nebula.widgets.nattable.core_1.1.0.201405201314
org.eclipse.nebula.widgets.nattable.extension.glazedlists_1.1.0.201405201314

-Layer Composition: We are using Composite Layer and is configured as:
CompositeLayer compositeLayer = new CompositeLayer(1, 2);
compositeLayer.setChildLayer(GridRegion.COLUMN_HEADER, sortHeaderLayer,0,0);
compositeLayer.setChildLayer(GridRegion.BODY, bodyLayer,0,1);

-specific selection handling: No
Re: Row selection Slow down in case of large data in NatTable [message #1416187 is a reply to message #1416168] Thu, 04 September 2014 14:21 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2902
Registered: July 2012
Senior Member
I modified the _5031_VerticalCompositionExample to use row selection and there is no delay.

So with all the examples I have I am not able to reproduce such a delay issue.

I know there was an issue that has been fixed with 1.1.0. But as you are using 1.1.0 you shouldn't face that one.

Maybe it is in your body layer composition. I really don't have a clue as it all works perfectly fine in the official examples.

If you are able to reproduce the issue by modifying a official example or provide an example the shows the issue, I can have another look. Although I think it is not an issue of NatTable.
Re: Row selection Slow down in case of large data in NatTable [message #1417435 is a reply to message #1416187] Fri, 05 September 2014 12:22 Go to previous messageGo to next message
Chetana Barhate is currently offline Chetana BarhateFriend
Messages: 18
Registered: February 2014
Junior Member
We got the problem in our code. We have added RowSelectionProvider in our code and its causing the problem.
Thanks for your help.

We require one more help for below problem:
Requiement: 1. On left click row should be selected
2. On right click row should be selected along with context menu should be display

To achieve above requirement we have adedd below code:
1. Row Selectiom model added
2. this.natTable.getUiBindingRegistry().registerMouseDownBinding(new MouseEventMatcher("BODY", 3), new SelectCellAction());

Problem: If we select multiple rows and then right click, it clears all selections and selects only right clicked row and opens a context menu

I am able to reproduce this issue by modifying a official example "Everything but the kitchen sink". It is attached with the post

Also we tried another solution by replacing new SelectCellAction() with new SelectRowGroupsAction() But it behaves as below:
When we select multiple rows and right cick, it opens context menu without clearing the selection (for all selected row).
Now if we right click on any other row, it open context menu but selection does not change (We require that the row which is right clicked must be selected and context menu should get opened for that row)

Hope you are able to understand our problem.



Re: Row selection Slow down in case of large data in NatTable [message #1417444 is a reply to message #1417435] Fri, 05 September 2014 12:57 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2902
Registered: July 2012
Senior Member
You need to implement a custom action that performs the necessary actions.
Re: Row selection Slow down in case of large data in NatTable [message #1417446 is a reply to message #1417444] Fri, 05 September 2014 13:03 Go to previous messageGo to next message
Chetana Barhate is currently offline Chetana BarhateFriend
Messages: 18
Registered: February 2014
Junior Member
Ok...

For that we have written the bolw code:
protected void addMouseRightClickBinding() {
tableComponent.getUiBindingRegistry().registerMouseDownBinding(
new MouseEventMatcher(GridRegion.BODY,
MouseEventMatcher.RIGHT_BUTTON), new IMouseAction() {
@Override
public void run(NatTable natTable, MouseEvent event) {
SelectRowGroupsAction selectrowgroup = new SelectRowGroupsAction();

ViewportSelectRowAction selectRowAction = new ViewportSelectRowAction(
false, false);
int rowPosition = LayerUtil.convertRowPosition(
natTable, natTable.getRowPositionByY(event.y),
selectionLayer);

if (!selectionLayer.isRowPositionSelected(rowPosition)) {
selectRowAction.run(natTable, event);
} else {
int sele = selectionLayer.getSelectedRowCount();
if (sele <= 1) {
selectRowAction.run(natTable, event);
} else if (sele > 1) {
selectrowgroup.run(natTable, event);
}
}
}
});
}

-----------------------------
It Solves our problem but not sure that its correct way or not. Please confirm.
Re: Row selection Slow down in case of large data in NatTable [message #1417451 is a reply to message #1417446] Fri, 05 September 2014 13:09 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2902
Registered: July 2012
Senior Member
Row groups are used with row grouping. It should be possible to execute a multi select action.
Re: Row selection Slow down in case of large data in NatTable [message #1417456 is a reply to message #1417451] Fri, 05 September 2014 13:25 Go to previous messageGo to next message
Chetana Barhate is currently offline Chetana BarhateFriend
Messages: 18
Registered: February 2014
Junior Member
Did you mean that there is any action available related to Multiple row selection?
Because I didn't find any action/command related to that...
Re: Row selection Slow down in case of large data in NatTable [message #1417461 is a reply to message #1417456] Fri, 05 September 2014 13:34 Go to previous message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2902
Registered: July 2012
Senior Member
Not an action, but the SelectRowsCommand. Actions are used to trigger commands.
Previous Topic:Expand singe top row in tree grid
Next Topic:Get Painted Cells
Goto Forum:
  


Current Time: Thu Mar 28 20:57:49 GMT 2024

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

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

Back to the top