cancel
Showing results for 
Search instead for 
Did you mean: 

table sorting

Former Member
0 Kudos

Hello All,

I already implement table sorting in my application.How can i trigger a table sort action on a particular column after I have compeleted some other action?

Thanks

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member182372
Active Contributor
0 Kudos

Hello vijay,

Type 'table sort' in 'Forum Search' field on main page of Dynpro forum, click 'Go' and you will get 818 result items for last 90 days describing various solutions and workarounds for your problem.

Best regards, Maksim Rashchynski.

Former Member
0 Kudos

Use IWDNode.sortElements(Comparator).

The Comparator instance passed to this method should cast its arguments to the node element interface and compare them by the attribute displayed in the particular column.

Say your node is named "Employees" and the attribute is "Name" and has type "String", then it looks like

Comparator comparator = new Comparator()
{
  public int compare(Object x1, Object x2)
  {
    IEmployeesElement e1 = (IEmployeesElement ) x1;
    IEmployeesElement e2 = (IEmployeesElement ) x2;
    return e1.getName().compareTo(e2.getName());
  }
};
node.sortElements(comparator);

Armin