Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » NatTable » Sort problem in TreeFormat
Sort problem in TreeFormat [message #1696299] Mon, 25 May 2015 10:44 Go to next message
cenk Mising name is currently offline cenk Mising nameFriend
Messages: 159
Registered: July 2009
Senior Member
We are try TreeGridExample.java for sorting the tree table.

When I change bar value (of "root") to 2, sorting for bar column is not working correctly. (bar value is same for "root" and "root2")

How can I fix it?

 private void createDatums() {
       // bar value ise same with root2
       [b] createDatum(null, "root", 2);[/b]

        createDatum("root", "A", 10);
        createDatum("A", "A.1", 100);
        createDatum("A", "A.2", 110);
        createDatum("A", "A.3", 120);
        createDatum("root", "B", 20);
        createDatum("B", "B.1", 200);
        createDatum("B", "B.2", 210);
        createDatum("root", "C", 30);
        createDatum("C", "C.1", 330);
        createDatum("C", "C.2", 370);
        createDatum("C", "C.3", 322);
        createDatum("C", "C.4", 310);
        createDatum("C", "C.5", 315);
        // bar value ise same with root
       [b] createDatum(null, "root2", 2);[/b]

        createDatum("root2", "X", 70);
        createDatum("X", "X.1", 700);
        createDatum("X", "X.2", 710);
        createDatum("X", "X.3", 720);
        createDatum("root2", "Y", 80);
        createDatum("Y", "Y.1", 800);
        createDatum("Y", "Y.2", 810);
        createDatum("root2", "Z", 90);
        createDatum("Z", "Z.1", 900);
        createDatum("Z", "Z.2", 910);
        createDatum("Z", "Z.3", 920);
        createDatum("Z", "Z.4", 930);
        createDatum("Z", "Z.5", 940);
    }

Re: Sort problem in TreeFormat [message #1696337 is a reply to message #1696299] Mon, 25 May 2015 20:11 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2803
Registered: July 2012
Senior Member
I'm not sure what you mean with "does not work correctly". But the TreeGridExample is a simple example with prepared data.

The elements in a TreeList need to be sorted correctly according the tree structure. That's why the TreeList.Format provides a Comparator. In the example a simple comparator is used that sorts only for the foo attribute. There is no additional check for parent-child relationship. With your change you broke that simple sort mechanism, because the two root nodes are equal.

So you need to provide a comparator that not only takes into account the foo attribute, but also the parent-child relationship. Then it should work correctly.
Re: Sort problem in TreeFormat [message #1698984 is a reply to message #1696337] Fri, 19 June 2015 10:14 Go to previous messageGo to next message
cenk Mising name is currently offline cenk Mising nameFriend
Messages: 159
Registered: July 2009
Senior Member
Dear Fauth,

I cannot find any solution. May you give simple example included parent-child relationship for sorting. How can I compare for correctly sorting

Thank You
Re: Sort problem in TreeFormat [message #1698993 is a reply to message #1698984] Fri, 19 June 2015 11:15 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2803
Registered: July 2012
Senior Member
Don't know. Maybe an issue with the SortableTreeComparator. Open a ticket.
Re: Sort problem in TreeFormat [message #1699083 is a reply to message #1698993] Sat, 20 June 2015 14:50 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2803
Registered: July 2012
Senior Member
Hm, it doesn't look like an issue in the SortableTreeComparator. The main problem is that the comparator doesn't know about the tree parent-child relationship.

I don't have the time to search for a solution and create an example. Have a look at GroupByComparator. AFAIK we solved that issue there somehow.
Re: Sort problem in TreeFormat [message #1699099 is a reply to message #1699083] Sat, 20 June 2015 22:35 Go to previous messageGo to next message
cenk Mising name is currently offline cenk Mising nameFriend
Messages: 159
Registered: July 2009
Senior Member
Dear Dirk,

We couldn't find any solution. We cannot implement GroupByComparator to our application(based on TreeGridExample). When will you have the time. May you release any example for this issue. Really We need a help.
Thank you
Re: Sort problem in TreeFormat [message #1699150 is a reply to message #1699099] Mon, 22 June 2015 07:01 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2803
Registered: July 2012
Senior Member
Quote:
When will you have the time


I don't know. Unless you are willing to sponsor the development, it has no priority for me.
Re: Sort problem in TreeFormat [message #1699633 is a reply to message #1699150] Thu, 25 June 2015 12:25 Go to previous messageGo to next message
cenk Mising name is currently offline cenk Mising nameFriend
Messages: 159
Registered: July 2009
Senior Member
Hi,

Is anyone there who encountered the problem. The Tree nattable cannot be sort with different column because of we cannot create parent-child relationship for comparing.

Nowadays If we cannot any solution we will give up the NatTable
Re: Sort problem in TreeFormat [message #1699639 is a reply to message #1699633] Thu, 25 June 2015 12:53 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2803
Registered: July 2012
Senior Member
https://www.eclipse.org/articles/Article-TreeViewer/TreeViewerArticle.htm
https://eclipse.org/nebula/widgets/grid/grid.php
https://eclipse.org/nebula/widgets/xviewer/xviewer.php

Since you don't want to pay for help, maybe you are able to solve your requirements using one of those widgets. Threaten me not to use NatTable anymore has no effect on my side.
Re: Sort problem in TreeFormat [message #1699645 is a reply to message #1699639] Thu, 25 June 2015 13:37 Go to previous messageGo to next message
cenk Mising name is currently offline cenk Mising nameFriend
Messages: 159
Registered: July 2009
Senior Member
Dear Dirk,

Thank you for your help since nowadays
But
I cannot understand what did you say. Threaten ? It can be joke. I think here is technical forum.You know
Why are you getting on you. Especially when I dont tell you.

Okey No problem

Thank you
Re: Sort problem in TreeFormat [message #1699650 is a reply to message #1699645] Thu, 25 June 2015 14:29 Go to previous messageGo to next message
cenk Mising name is currently offline cenk Mising nameFriend
Messages: 159
Registered: July 2009
Senior Member
Dear Dirk,

How much should I Pay your help and a example
Re: Sort problem in TreeFormat [message #1699715 is a reply to message #1699650] Fri, 26 June 2015 06:50 Go to previous message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2803
Registered: July 2012
Senior Member
First to clear things, I'm a consultant and typically I'm getting paid for my work. This is nothing private or personal thing, it is my job.

Second, when you say you will give up using NatTable if you don't get help, it sounds like a threat. Not a personal threat, maybe there is some missunderstanding. More like "if I don't get xxx I will yyy"

Third, you are right when saying this is a technical forum. And it is public. Therefore I won't answer a question on estimates and costs here. Please write me an email with an official request and I will create an official offer for you.
Previous Topic:Issue with combobox Editor
Next Topic:Nabula Nattable Auto resize
Goto Forum:
  


Current Time: Fri Feb 26 19:19:20 GMT 2021

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

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

Back to the top