cancel
Showing results for 
Search instead for 
Did you mean: 

Ascending and descending Table sorter in webdynpro java table

prasad
Participant
0 Kudos

Hi,

We are on NW 7.3 Portal and  implemented Table filter and Sorter in Webdynpro java . every thing is working fine but column sorting is not happening in descending order.

Clicking on column once changing to ascending order, again clicking on column doesn't change to descending order. is there any extra coding to be done for making the column both ascending and descending sorting.

Please do the needful

Regards

Prasad

Accepted Solutions (0)

Answers (1)

Answers (1)

vijay_kumar49
Active Contributor
0 Kudos

Prasad,

Could you please provide the sorting fuctionality code.

Mean while please look at

Table Sorter - Java class used for table sorting (Web Dynpro Java)

http://wiki.scn.sap.com/wiki/pages/viewpage.action?pageId=342000745

How to Implement a Web Dynpro for Java Table with Sorting Capabilities

http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/e0cf0997-2e08-2d10-b08e-964a2c04c...

Please look at these document.

Hope this is helpfull for you.

Regards

Vijay K

prasad
Participant
0 Kudos

Hi Vijay

Thanks for your reply.

here is the steps i followed

created a node(0..n) in component controller mapped to view controller . added  standard Table sorter.java to project. Created a action for Filter in webdynpro table . created a Table sorter attribute of Table sorter.java

added the following  code in action sort

public void onActionSort(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )

  {

    //@@begin onActionSort(ServerEvent)

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

   

    //@@end

  }

Dataset is the  name of the node.

in wddomodify

public void wdDoModifyView(com.sap.tc.webdynpro.progmodel.api.IWDView view, boolean firstTime)

  {

    //@@begin wdDoModifyView

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

      wdContext.currentContextElement().setTableSorter(

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

      //@@end

  }

Please do the needful

Regards

Prasad

vijay_kumar49
Active Contributor
0 Kudos

Prasad,

I think from WD-JAVA side, the code is currect.

Table Sorter - Java class having ascending order and descending order related code. Please check it.

Please look at below threads.same requirement they have.

http://scn.sap.com/thread/3354713

http://scn.sap.com/thread/927550

http://scn.sap.com/thread/220732

Regrds

Vijay