cancel
Showing results for 
Search instead for 
Did you mean: 

Table Sorting based upon columns

Former Member
0 Kudos

Hi All,

I am using NWDS 04. I have to use column based sorting for the tables.

I came to know that i need to use one .java filename TableSorter.java and need to paste this in the src/,but when I am trying to attach the TableSorter.java file into my Web dynpro project i am getting errors, and i have done organize import but it is not recognizing some of the standard statements like IWDAbstractTableColumn, IWDTableColumnGroup.

Do I need to use any jar file for this.

Please help. Its very urgent.

Regrds,

Nelly

Accepted Solutions (0)

Answers (6)

Answers (6)

Former Member
0 Kudos

Hi Nelly,

those classes were introduced in NW04s.

But you may rewrite the sorting class using only IWDTableColumn.

Former Member
0 Kudos

Hi

[Enhanced Web Dynpro Java TableSorter for SAP NetWeaver 04s|https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/3287] [original link is broken] [original link is broken] [original link is broken];

[Forum|]

Mandeep Virk

PradeepBondla
Active Contributor
0 Kudos

In the stating of your code... you have to import the table sorter.... with import statement.

import the package where you added table sorter file.

did you do that?

PradeeP

Former Member
0 Kudos

Hi,

Have a look at this thread.

/message/5825924#5825924 [original link is broken]

Regards,

Krishna.

srinivas_sistu
Active Contributor
0 Kudos

Hi Nelly,

I think you have to use NWDS04s not NWDS04....

Please find the below thread....

Regards,

Srinivas.

Former Member
0 Kudos

Hi Srini,

I came to know that we can develop this in NWDS04 also. But in my case it is not accepting. That's why I am asking whether we need to add any jar file for the same.

Regards,

Nelly

former_member201361
Active Contributor
0 Kudos

hi ,

i think u will not be able to do sorting since the table column group is introduced after nw04.

if possible please check whether u are able to create a Table Gropued Columns .

open the view and insert child ---Table .

in the table whether u can add Table grouped Columns and IWDAbstract Columns ..

Thanks and Regards

Former Member
0 Kudos

1. Choose the view which contatins the table.

2. Switch to the Context tab page.

3. Using the secondary mouse button, click Context, choose New u2192 Value Attribute, enter TableSorter as name, and confirm by pressing Finish.

4. Select the value attribute TableSorter and choose the type property in the lower window in the Properties tab.

5. Click the pushbutton …, choose Java Native Type and enter com.sap.tc.webdynpro.tests.utils.TableSorter. Confirm choosing OK.

6. Switch to the Actions tab, and create an action using New. Assign Sort as name and text, and confirm by pressing Finish.

7. Switch to the Implementation tab page and add the following program code into the wdDoModifyView method:

wdDoModifyView()

//@@begin wdDoModifyView

if (firstTime) {

IWDTable table = (IWDTable) view.getElement("ShoppingBasket");

wdContext.currentContextElement().setTableSorter(

new TableSorter(table, wdThis.wdGetSortAction(), null));

}

//@@end

8. Switch to the method onActionSort and enter the following source code:

onActionSort()

//@@begin onActionSort(ServerEvent)

wdContext.currentContextElement().getTableSorter().sort(wdEvent, wdContext.nodeProducts());

//@@end

At runtime, a context element provided in the context is addressed in this way. It, in turn, addresses the current table sorter.

You will find the program code for the sort class under sac u2192 packages in the package com.sap.tc.webdynpro.tests.utils.TableSorter.

9. Start the context menu of the implementation and choose Source u2192 Organize Imports.

10. Save the current status of your project by choosing Save all Metadata.

See this link for sorting table columns

Thanks ,

Tulasi

Edited by: Tulasi Palnati on Jul 23, 2008 2:22 PM