cancel
Showing results for 
Search instead for 
Did you mean: 

problem sorting the table .

Former Member
0 Kudos

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 ?

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

nbbbb

nikhil_bose
Active Contributor
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

hi

thanks for the response

i have tried wht u have posted above ,

but table sorting in working fine when iam creating

table using Value Node

but its failing when iam working this sorting scenario

on Model Node Table .

its showing error in the action method

sort();

i cannot copy model node data to the value node

as this will effect the performance of the application

there is huge amount of data present in the table .

can any one help ?

former_member201361
Active Contributor
0 Kudos

Hi Kishore ,

U have make the Table sorting on the value nodes . try coping all the model node data to the value node .

the best practice is use only the value nodes for table sorting and table filtering .

thanks and regards

Former Member
0 Kudos

hi

thanks for the response

i cannot copy the model node data to the value node

as i am performing some operations in the itemlistbox

and then populating the model node table

and there will be thousands of data , so copying

the data to the value node will affect the performance

and other thing is i have one more table of model node

where i have to perform sorting , so is there a way

that TABLESORTING can be directly performed on the

model node , i have to perform ascending and descending order sorting on the two tables w.r.t the columns

can any one help me out ?

former_member201361
Active Contributor
0 Kudos

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

PradeepBondla
Active Contributor
0 Kudos

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.

this will solve your problem.

regards,

Pradeep

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