cancel
Showing results for 
Search instead for 
Did you mean: 

Tablesorter class

Former Member
0 Kudos

Hi

I followed the following blog to implement sorting on flight list

/people/bertram.ganz/blog/2006/03/07/enhanced-web-dynpro-java-tablesorter-for-sap-netweaver-04s

But I am not getting sort icons for the table so I dont know whether sorting is working or not.

Please let me know why sorting icons are not visible

Thanks

Bala Duvvuri

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Please help me in understanding

wdContext.currentContextElement().setCustomerTableSorter(

new TableSorter(table, wdThis.wdGetSortCustomersAction(), null, new String[] { "CustomerTable_Name" }));

which is in the blog mentioned in the post.what is this CustomerTable_Name

If i comment the below code in the wdDoModifyView()

if (firstTime) {

//view.nowCreateAllCustomExtensionFields();

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

wdThis.wdGetAPI().getComponent().getMessageManager().reportSuccess("User:3"+table);

wdContext.currentContextElement().setTableSorter(

new TableSorter(table, wdThis.wdGetSortAction(), null, new String[] { "Table" }));

wdThis.wdGetAPI().getComponent().getMessageManager().reportSuccess("User:3"+wdContext.currentContextElement().getTableSorter());

}

I am able to see the sort icons in my table.But if i click on them obviously it will throw exception.

Please help me in resolving this issue

Thanks

Bala Duvvuri

Former Member
0 Kudos

Hi Bala,

The best way to understand TableSorter might be directly inspecting its source code.

FYI. About "CustomerTable_Name":

public TableSorter(IWDTable table, IWDAction sortAction, Map comparators, String[] sortableColumns) {
	init(table, sortAction, comparators, sortableColumns);
}

So, the "CustomerTable_Name" should be the column-names of the Table UI Element, by which you would like to sort.

If you want to sort by "Column1", just use {"Column1"}.

snehal_kendre
Active Contributor
0 Kudos

HI Bala,

here

wdContext.currentContextElement().setCustomerTableSorter(

new TableSorter(table, wdThis.wdGetSortCustomersAction(), null, new String[] { "CustomerTable_Name" }));

CustomerTableSorter is the context whos datatype is tablesorter class.

new TableSorter(table, wdThis.wdGetSortCustomersAction(), null, new String[] { "CustomerTable_Name" }));

its the constructor...

"CustomerTable_Name" is the name of table column. on which sorting is performed.

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

Is it possible to view the sorting icon without implementing tablesorter class. I know it can be achieved by adding image to header, but i want to enable the original one.