on 02-02-2009 1:23 PM
Hi,
I have 2 related questions :
1. How the sortstate is working(column property) ?
2. How to use initial sorting (first time) ?
Thanks,F.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi All,
I forgot to mention that I know about the TableSorter class...
and I am using it in my applications...But what i need is :
1 . I want that the table will be sorted by X column in the first time.
Now just when we click the header the sort is working.
2. Multiple sorting
Can i do it with the TableSorter class ( NW7 )
Thanks,
F
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
You cannot do multiple sorting with the TableSorter class. Also there is no configuration in the tablesorter class to sort at load. You will have to implement both by your own.
TableSorter class basically does a sort on the context node. So for multiple field sort you will have to manipulate the sort order yourself. For initial sorting you can use the tablesorter class.
Regards,
Sanyev
Hi F,
I cant exactly get what you mean by firsttime X column sorting , but i suppose you want the table to be sorted when loaded , you can code it in wdDoModifyView method ,
> if (firstTime) {
> IWDTable table = (IWDTable) view.getElement("XXX");
> wdContext.currentContextElement().setTableSorter(new TableSorter(table,wdThis.wdGetSortAction(),null));
where firsttime is a boolean variable passed as a parameter to that wdDoModifyView method itself
Hope this answer is relevant to your question as i havn't got ur question clearly !!!!
Regards,
Sam Charles J.
Hi F.F,
What I meant was that you can use the methods of TableSorter class to initially sort your table when you load your application. You don't have to write your own sorting algorithm to achieve this. But for multiple sorting TableSorter class is useless. You will have to implement your own sorting algorithm.
Sanyev
Hi
check this blog for Table Sorter
/people/bertram.ganz/blog/2006/03/07/enhanced-web-dynpro-java-tablesorter-for-sap-netweaver-04s
Edited by: Tulasi Palnati on Feb 3, 2009 7:18 AM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi F,
1. Regarding the working of sorting ,
you will be creating a attribute for tablesort and giving its type as com.sap.tc.webdynpro.tests.utils.TableSorter under java native type.
You will find the program code for the sort class under src u2192 packages in the package com.sap.tc.webdynpro.tests.utils.TableSorter.
2. Regarding the firsttime sorting,
See the following link,
Where in page no 18, they used the code to sort the table in wdDoModifyView method, there the variable firstTime is a boolean variable passed as a parameter in the methos wdDoModifyViewitself. thus the first time sorting works.
follow that link for complete table sort procedure !
Regards,
Sam Charles J.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi F,
You can read through this blog about TableSorter in Webdynpro Table.
[https://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/3287] [original link is broken] [original link is broken] [original link is broken];
In a Webdynpro table you have to implement your own sorting. Already implemented sorter classes like the one mentioned in the blog above are available and the developer can just use those.
For your first question, If initially sortstate is set then a sort icon will be visible in the table column. When ever the user click the sort icon you will get an event and the event handler can do the sorting of the data. When the user clicks the the sort state of the IWDTableColumn will change and can be read using the getSortState() api.
You will have to do the initial sorting. If you want the first column to be sorted on load then you will have to set the appropriate sort state of that column and do the sorting.
Hope this helps.
Regards,
Sanyev
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 | |
24 | |
11 | |
9 | |
7 | |
6 | |
5 | |
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.