on 12-14-2007 5:51 AM
Hi,
I have a webdynpro table with Columns Document Name,Path,Hits. I want to sort the Table based on the Hits on descending order. I wrote a piece of code to sort it, but not getting sorted.
import java.util.Comparator;
wdContext.nodeKMAccess().sortElements(
new Comparator()
{
public int compare(Object x, Object y)
{
IPrivateDocHits1.IKMAccessElement rx = (IPrivateDocHits1.IKMAccessElement)x;
IPrivateDocHits1.IKMAccessElement ry = (IPrivateDocHits1.IKMAccessElement)y;
if (rx == null) return ry == null ? 0 : 1;
return rx.getHits().compareTo( ry.getHits() );
}
}
);
There is no error. But not getting sorted. I gave this code
wdContext.nodeKMAccess().sortElements(GenericNodeElementComparator.desc("Hits")
new Comparator()
But it is giving me an erorr. Can anyone help me out in solving this issue.
Regards,
Divya
Hi Divya,
Use this
<a href="/people/bertram.ganz/blog/2006/03/07/enhanced-web-dynpro-java-tablesorter-for-sap-netweaver-04s:///people/bertram.ganz/blog/2006/03/07/enhanced-web-dynpro-java-tablesorter-for-sap-netweaver-04s
regards
Sumit
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Thanx for the reply. But what is that onSort event of the table and the onAction event of the table column? I want the table to be sorted in descending order automatically based on that column when the project runs. For that why should i give an action to the table.
Sorry if what i ask is wrong.
Regards,
Divya
Hi ,
I have downloaded the zip file for the TableSorter Class. I have added all the necessary codes for sorting a table. ut it is showing me an error.
"import com.sap.tc.webdynpro.test.utils.TableSorter". cannot be resolved or not a type.
What jarfile should i import for this? The only error is this.What jarfile should i import for this?
Regards,
Divya
User | Count |
---|---|
95 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.