cancel
Showing results for 
Search instead for 
Did you mean: 

Sorting problem in Tables

Former Member
0 Kudos

I've got a very strange problem while sorting table columns in WebDynpro Java.

I followed every step in the tutorial and imported the TableSorter.java into my project. But the columns in my table is still unsortable. I tried every effort but failed to make it sortable. Anyone encountered the same problem with me? Thanks in advance!

PS: I strictly followed the tutorial chapter 11's steps so do not tell me refer to that tutorial.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Sam,

In the table columns ,sort icon is available?? Have u tried to check whether the onSort action is getting called or not??

put some print statement in onSort event handler & check.

regards

Sumit

Former Member
0 Kudos

Hi Sumit,

There's no sorting icons displayed in my table columns. And also there's no sorting links in the columns. The onSort action was not called also.

I noticed that in the tutorial the table's sort action is dynamically binded instead of filling in the table's sort action field.

Thank you and looking forward to your help.

Former Member
0 Kudos

Hi Sam,

If u r not getting the icon itself, its implementation problem. Just check again ur code.

Can u send the code u have written for this??

regards

Sumit

Former Member
0 Kudos

Hello Sumit,

I've just searched the forum again and found a post answered by Armin Reichert:

"A possible reason might be that you have added table columns using the "GroupedColumns" aggregation (which is default in NW04s) but your TableSorter code still assumes that the columns are in the "Columns" aggregation (was default in NW04)."

The way to resolve this issue is simple as follow:

Replace

for (Iterator it = table.iterateColumns(); it.hasNext(); ++index)

by

for (Iterator it = table.iterateGroupedColumns(); it.hasNext(); ++index)

in your TableSorter.java.

I tried this and it worked! Thank you Sumit.