cancel
Showing results for 
Search instead for 
Did you mean: 

Sort feature on tables

Former Member
0 Kudos

I am developing a web dynpro app that involves displaying BAPI results in a table. What I have seen, and would like to see in my app is the column sorting feature that comes with the table widget.

Though I see it at design time, but when I run the application I dont see the "arrows" that sort the column.

Any ideas what needs to be done ?

Thanks in advance !

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member182372
Active Contributor
0 Kudos

Hello Srikanth,

It was discussed sooo many times:

https://forums.sdn.sap.com/search!execute.jspa?forumID=59&forceEmptySearch=true&q=table+sort&objID=f...

Best regards, Maksim Rashchynski.

Former Member
0 Kudos

There is no built-in sort feature in the IWDTable, the icons shown in the view designer are a little bit misleading.

What you can do is: attach an action to the IWDTableColumn.onAction event which is triggered when the column header is clicked. The column ID is passed to the server in the event parameter "col". You can use parameter mapping to pass this value to the action handler.

In the action handler, sort the node element list by the attribute values displayed in this column, see IWDNode.sortElement(Comparator).

The table tutorial contains a generic TableSorter class (courtesy Thomas Chadzelek) that may be attached to a table with a single statement and provides this sorting functionality.

Armin