on 05-07-2013 10:01 AM
Hi Expert,
I have created a table in Webdynpro Java with 2 columns NAME , AGE with rows values as (ABC,16 and XYZ 20) The requirement is when user click on any of the column that column should sort in ascending or descending order. Eg. If I click on NAME, rows should be (ABC,16 and XYZ 20), on again clicking NAME column, rows should display (XYZ 20 and ABC 16). Similarly, when I click on AGE it should sort the rows in ascending or descending order based on age values.
I found the solution, where JAVA CLASS for Table Sort has been used.
I do not want to use this JAVA CLASS, please help
Regards,
Khushboo
Hi Luis,
I am using NWDS 7.1.
I already tried with JAVA Class but that is not working. Its giving me arrows on the column but not sorting it on click.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi, Khushboo
try this in sort event
SorterScn sorter = new SorterScn();
wdContext.nodeNodoscn().sortElements(sorter);
and add this class to your code
public class SorterScn implements Comparator<IWDNodeElement>{
@Override
public int compare(IWDNodeElement o1, IWDNodeElement o2) {
// TODO Add parameters to compare byName or By Age
return o1.getAttributeAsText("Name").compareTo(o1.getAttributeAsText("Name"));
}
}
If the table is dynamically populated what should be done, I have a link to tutorial which shows how to insert sorting .
http://scn.sap.com/people/peter.vignet/blog/2007/01/03/generic-web-dynpro-java-table-filter
But if the table is not in the View and it is dynalically inserted using code, What shouldbe done ?
Please help.
Sorry for late reply..
That requirement got cancelled.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
why not use that one?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi, which version of netweaver are you running ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can archive this sorting by use the table sorter classes only.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
25 | |
12 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.