on 08-21-2007 7:02 AM
Hi all,
I had gone through the PDF given (Developing with tables in webdynpro).
i got struck in creating TableSorter.java file...
can any one tell me how to create that java file in my project and how to send the colum which i want to sort to TableSorter.java
Regards
Padma
To implement it ,create a value attribute say "sorter" of java native type
com.sap.tc.webdynpro.tests.utils.TableSorter. (The package name MIGHT be different.)
In wdDoModifyView,obtaine a refernce to the table objject like
table = (IWDTable)view.getElement("table ui name);
and use
wdContext.currentContextElement().setSorter(
new TableSorter(table, wdThis.wdGet
<action name for sort>Action(), null));
Now inside that action handler,
wdContext.currentContextElement().getTableSorter().sort(wdEvent,
wdContext.node<nodename>());
also chk it
null
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
i created all these which you mentioned.But i simply copied the code of TableSorter.java into my project.But nocolumn in the table is getting sorted
I am not understanding where we are sending the coulmn which we want to sort out of many colums
I am not understanding the code written in TableSorter.java
By default the TableSorter automatically makes all table columns sortable (i.e. all context attributes). You just have to use the first constructor which does not have the String array parameter (IDs of sortable columns).
public static void wdDoModifyView(
IPrivateWork wdThis, IPrivateWork.IContextNode wdContext, com.sap.tc.webdynpro.progmodel.api.IWDView view, boolean firstTime)
{
//@@begin wdDoModifyView
if (firstTime) {
IWDTable table = (IWDTable) view.getElement("CustomerTable");
wdContext.currentContextElement().setCustomerTableSorter(
new TableSorter(table, wdThis.wdGetSortCustomersAction(), null));
}
//@@end
}
Hi,
i did in the same way you said,i think the problem is with TableSorter.java
Is it pre-defined java class or we have to write the code
<b>You just have to use the first constructor which does not have the String array parameter (IDs of sortable columns).</b>
i didnt understand this..can u explain me deatliy where i have to modify my TableSorter.java to sort my Tbale coulms
create <Sort> action and bind this to onSort property of the table.
wdContext.currentContextElement().get<Sort>().sort(wdEvent, wdContext.node<>());
http://help.sap.com/saphelp_erp2005/helpdata/en/93/6ce9403070712ae10000000a155106/frameset.htm
/people/peter.vignet/blog/2007/01/03/generic-web-dynpro-java-table-filter
Hi,
i just copied TableSorter.java in my project.But the colums in the table are not getting sorted.and the code i added to my view is
public static void wdDoModifyView(IPrivateResultView wdThis, IPrivateResultView.IContextNode wdContext, com.sap.tc.webdynpro.progmodel.api.IWDView view, boolean firstTime)
{
//@@begin wdDoModifyView
if(firstTime)
{
IWDTable table=(IWDTable)view.getElement("Table");
wdContext.currentContextElement().setTableSorter( new TableSorter(table,wdThis.wdGetSortAction(),null));
}
//@@end
}
public void onActionSort(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
{
//@@begin onActionSort(ServerEvent)
wdContext.currentContextElement().getTableSorter().sort(wdEvent, wdContext.nodeMatrl_List());
//@@end
}
Should i need to make any changes to TableSorter.java
Hi Padma,
This is the code u have to write in wdDoModifyView:
public static void wdDoModifyView(
IPrivateWork wdThis, IPrivateWork.IContextNode wdContext, com.sap.tc.webdynpro.progmodel.api.IWDView view, boolean firstTime)
{
//@@begin wdDoModifyView
if (firstTime) {
IWDTable table = (IWDTable) view.getElement("CustomerTable");
wdContext.currentContextElement().setCustomerTableSorter(
new TableSorter(table, wdThis.wdGetSortCustomersAction(), null, new String[] { "CustomerTable_Name" }));
}
//@@end
}
here table is ur table name and the string array u r passing ,in that ur column names should be available. U r not passing any column in that.So it will not show any sort icon itself.
Check this url for further info;
<a href="/people/bertram.ganz/blog/2006/03/07/enhanced-web-dynpro-java-tablesorter-for-sap-netweaver-04s Sorter</a>
regards
Sumit
Hi Padma,
Its same what u did with this thread :
When u get a reply ,u will get something like this in left side of the answer
Posts: 475
Questions: 42
Registered: 8/8/06
Forum points: 558
Unassign
Solved problem (10)
Very helpful answer (6)
Helpful answer (2)
U can click on solved problem radio button for closing the thread
regards
Sumit
User | Count |
---|---|
84 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
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.