cancel
Showing results for 
Search instead for 
Did you mean: 

Sorting table in dialog box

Former Member
0 Kudos

Hi,

I am facing problems while sorting table.

Sorting is not taking place after clicking on column header.In fact no action is getting called when user clicks on table header.

  • I have followed all the steps in tutorial "Developing with tables in Web Dynpro".

  • The table to be sorted is in popup window.

  • There is one more table in main view (not in popup view), for which sorting is

working fine

  • I have added try - catch block for the sort action as well as in wdDoModifyView

method and there is no exception.

What can be causing problem?

Thanks in advance,

Apurva

Accepted Solutions (0)

Answers (8)

Answers (8)

Former Member
0 Kudos

Hi,

Problem got solved by changing Table Sorter.

Regards,

Apurva

Former Member
0 Kudos

Hi Apurva,

read this .

Regards.

Pedro

Former Member
0 Kudos

Hi Pedro,

I am Nikhil, Apurva's colleague, working on the same Sorting application.

I have tried the new TableSorter.java, but still the problem persists.

Actually, we are getting NullPointerException in sort method of TableSorter. The exception is because we are getting columnId and direction null from the foll. code

String columnId = wdEvent.getString("selectedColumn");

String direction = wdEvent.getString("sortDirection");

Plz let us know what are we missing.

Regards

Nikhil

Former Member
0 Kudos

Hi,

After adding some debugging comments, I got that column id passed to 'sort ' method 'TableSorter' class in utilities is null.

Hence, no sorting is taking place.But I still don't know why column id is not getting passed?

Any help?

Also, there is one property called 'sort state' for column of the table.What is significance of this property?

Regards,

Apurva

Former Member
0 Kudos

Hi,

1. When I added action for onActionSort I get small triangle in table header row.

Sort method is executed but no sorting take place.

Sorting is working for other table without giving any event for onSort.Big sorting

symbol becomes visible when I click on any cell in header row and sorting take

place based on that column. But the same thing is not working in other table.

Are there two types of sorting in Web Dynpro?

2. Table name is correct, Node name is correct.

What can be the reason for the problem?

Thanks in advance,

Apurva

Former Member
0 Kudos

Hi Apurva,

The steps are good, say me

Where has you put this code? in what view?

In wdDoModifyView, do you have some additional code?

Greetings

Peter

Former Member
0 Kudos

Hi Apurva,

Do you set the sort action for column onAction event?

Check it.

It may be a problem in your case.

Former Member
0 Kudos

Hi,

Thanks for quick response.

Steps I followed for Sorting are as follows:

1. Created context attribute 'TableSorter' of type TableSorter

2. Created Action 'Sort'

3. Added following code in wdDoModifyView

if (firstTime) {

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

wdContext.currentContextElement().setTableSorter(

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

}

4.Added following code in onActionSort method

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

wdContext.nodeXYZ());

Nothing happens when I click on Table header.

Am I missing some step?

Is it because table is in dialog box and not in main view?

Thanks,

Apurva

Former Member
0 Kudos

Apurva,

Two possibilites:

1) Check if the Table`s ID you've specified in the code below is correct or not:


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

2) Check if you've bound the correct node to the datasource property of the table. Also, check if you are passing the correct node to the table sorter in the SortAction (which is nodeXYZ() in your case)

Bala

Former Member
0 Kudos

Hi Apurva,

Can u send the code u have written for sorting in wdModifyView as well as in event handler??without that its not possible to find out the problem.

regards

Sumit