Skip to Content
avatar image
Former Member

problem sorting the table .

hi

iam trying to sort the table in ascending

and descending order ,

but iam not able to sort my model node table .

below is the code i have written

and other thing i have created a class called Tablesorter.java

and copied the code of the TableSorter present in

IDE\eclipse\examples as i was not able to copy and

paste the TableSorter Class , in the

src\pkg.

import com.sap.tc.webdynpro.tests.utils.TableSorter;

if(firstTime)

{

view.nowCreateAllCustomExtensionFields();

IWDTable tab= (IWDTable)view.getElement("Table");

wdContext.currentContextElement().setCustomerTableSorter(new TableSorter(tab,wdThis.wdGetTableSortAction(),null,new String[] {"Customers") ));

}

in the above coding i am getting error as Constructor TableSorter is undefined.

wdContext.currentContextElement().getCustomerTableSorter().sort(wdEvent,wdContext.nodeCustomers());

can any one help me out ?

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • avatar image
    Former Member
    Jun 26, 2008 at 10:59 AM

    HI create Value attribute TableSorter and bind the Java native type(TableSorter) to this Table sorter attribute property type

    In DoModfiy View

    if(firstTime)

    {

    IWDTABLE table =(IWDTABLE)View.getElement("Table");

    wdContext.CurrentcontextElement().setTablSorter(new TableSorter(table,wdThis.wdGetsortaction(),null));

    }

    create a action on table sort

    wdcontext.currentcontextElement().getTableSorter().sort(wdEvent,wdcontext.nodeItab());

    try this code

    Thanks and Regaards,

    Tulasi.Palnati

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi Kishore,

      Ya u can use the model node for the table sorting .

      Please check whether the constructor which u have defined is present in the table sorter class .

      Thanks and Regards

  • Jun 26, 2008 at 10:01 AM

    Hi,

    one easy way is, copy model node to some custom node and then do the same, then it will work for sure.

    once again check the TableSorter code with below code.

    table-sorter

    this will solve your problem.

    regards,

    Pradeep

    Edited by: pradeep bondla on Jun 26, 2008 12:04 PM

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jun 27, 2008 at 11:09 AM

    kishore,

    replace your code by

    if(firstTime)
    {
    view.nowCreateAllCustomExtensionFields();
    IWDTable tab= (IWDTable)view.getElement("Table");
    wdContext.currentContextElement().setCustomerTableSorter(new TableSorter(tab,wdThis.wdGetTableSortAction(),new HashTable() ,new String[] {"Customers") ));
    }
    

    do organize imports

    nikhil

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jan 03, 2011 at 05:26 AM

    nbbbb

    Add comment
    10|10000 characters needed characters exceeded