cancel
Showing results for 
Search instead for 
Did you mean: 

Sort , filter table with tree structure

0 Kudos

Hi, i need to sort my table with generic Tree structure.

TableSort class is already written, but as i understand(i have already tried) i can use it only for the normal table, not for my case. Schould i write the new class from scratch or possibly is it only some changes i need to perform in TableSort(for example in Comparator part )?

Thank you in advance!

Kind Regards,

Daria

P.S. the same problem with TableFilter

#######################

i have solved the Problem with sort function i have just added in onActionsort event this code:

Table()->Root Node

TableRec()->recursive Node

for(int i=0;i<wdContext.nodeTable().size();i++){

IPrivateChangeListikView.ITableElement newElem =(IPrivateChangeListikView.ITableElement)

wdContext.nodeTable().getElementAt(i);

IPrivateChangeListikView.ITableNode newnode= newElem.nodeTableRec();

wdContext.currentContextElement().getTableSorte().sort(wdEvent,newnode);

for(int j=0;j<newnode.size();j++){

IPrivateChangeListikView.ITableElement newElem2 =(IPrivateChangeListikView.ITableElement)newnode.getElementAt(j);

IPrivateChangeListikView.ITableNode newnode2= newElem2.nodeTableRec();

wdContext.currentContextElement().getTableSorte().sort(wdEvent,newnode2);

}

}

Edited by: Daria Sosunova on Apr 1, 2008 4:56 PM

Still the problem with filter remains...

Edited by: Daria Sosunova on Apr 1, 2008 5:02 PM

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hello daria,

Go through this

Enhanced Java WebDynpro Table sorter

/people/bertram.ganz/blog/2006/03/07/enhanced-web-dynpro-java-tablesorter-for-sap-netweaver-04s

Enhancing Table Performance

https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/webcontent/uuid/7d646a6c-0501-0010-b480-bf47b... [original link is broken]

Regards

- Vinod

*

0 Kudos

Hello Vinod,

thank you for help. But as already mentioned ,sort class is ok ,filter class also. I only need to know if i can, if yes, how to use the same filte calss with filter function to filter my Table with tree structure?

it's my table as example

dev-- | server | name |

- nw--

-123 p300 hallo

-345 dt00 kuku

-789 p300 hallo

- db--

-348 p300 kuku

-675 ls00 kuku

As you can see only leafs, in these case numbers have any data for server, name column, so i need to filter for example server as " ls", so i schould get after filtering dev->db->675 only

Thank you !

Kind Regards,

Daria

Edited by: Daria Sosunova on Apr 3, 2008 1:47 PM

former_member751941
Active Contributor
0 Kudos

Hi Daria,

Yes you can change the TableSort.java file

After Adding the TableSorter class TableSorter.java to the new package folder src/packages/com/sap/tc/webdynpro/tests/utils

RightClick on TableSorter.java

choose Properties and Uncheck Read only.

Then do the modification.

Regards,

Mithu

0 Kudos

Hi Mithu,

thank you for your reply! As above mentioned , i have solved the problem with TableSorte other way without changing the code and it seams still working:) Unfortunately i have not found any useful information for TableFilter class issue, all is more about sort problems.

Could you have a look again please?

Thank you & Best Regards,

Daria

former_member751941
Active Contributor
0 Kudos

Hi Daria,

Check this links.

Regards,

Mithu

0 Kudos

Hi Mithu, thank you for the links. But my problem is still the same. TableFilter class is ok , i have already used it successfully for tables without MasterColumn UI.

In my case i need to filter table with tree structure(node has recursive node). It means that sometimes i need to filter only leafs. I have tried already to filter only leafs, but sometimes(i don't catch when ) i got exception, also i need to delete nodes, which have no children.

here is my code in onActionFilter:

nodeFilterTable()->node wich must be filtered

nodeFilterTableRec()->recursive node for nodeFilterTable()

nodeTableNode ()->datasource

nodeTableNodeRec()->recursive node for datasource

for(int i=0;i<wdContext.nodeFilterTable().size();i++){

IPrivateChangeListikView.ITableElement newelem1= (IPrivateChangeListikView.ITableElement)wdContext.nodeTable().getElementAt(i);

IPrivateChangeListikView.IFilterTableElement newelem2 =(IPrivateChangeListikView.IFilterTableElement)wdContext.nodeFilterTable().getElementAt(i);

IPrivateChangeListikView.ITableNode newnode1=newelem1.nodeTableRec();

IPrivateChangeListikView.IFilterTableNode newnode2=newelem2.nodeFilterTableRec();

for(int j=0;j<newnode2.size();j++){

IPrivateChangeListikView.IFilterTableElement

IPrivateChangeListikView.ITableElement newelem3= (IPrivateChangeListikView.ITableElement)newnode1.getElementAt(j);

newelem4 =(IPrivateChangeListikView.IFilterTableElement)newnode2.getElementAt(j);

IPrivateChangeListikView.ITableNode newnode3=newelem3.nodeTableRec();

IPrivateChangeListikView.IFilterTableNode newnode4=newelem4.nodeFilterTableRec();

//filter leafs only

wdContext.currentContextElement().getTableFilter().filter(newnode3,newnode4);

}

}

Thank you in advance,

Best Regards,

Daria