cancel
Showing results for 
Search instead for 
Did you mean: 

TableSorter .java -- wdEvent is null

Former Member
0 Kudos

Hi All,

I am trying to sort the contents of my table column and I am using the TableSorter.java for achieving the same.

When I call the sort method of the class TableSorter and on debuging, the control comes to sort function on sort event:

public void sort(IWDCustomEvent wdEvent, IWDNode dataSource)

{

// find the things we need

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

IWDTableColumn column = (IWDTableColumn) table.getView().getElement(columnId);

........

but <b>columnId is Null</b>.

Could you please help me and suggest what parameter to pass in place of "col" ??

Regards,

mahesh

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Mahesh,

Make sure you have written the following code snippet in your wdDoModify()

if (firstTime)

{

IWDTable table = (IWDTable) view.getElement("<table name>");

wdContext.currentContextElement().set<yourTableSorter_attribute>(new TableSorter(table, wdThis.wdGet<Action Name>Action(), null));

}

Best Regards,

Nibu.

Former Member
0 Kudos

I guess it has nothing to do with that but my experience is that it is VERY important that the node which contains the data which should be sorted is a VALUENODE and not a MODELNODE! I used a MODELNODE and I was searching for the error for about 3 days...

Former Member
0 Kudos

Which TableSorter class are you referring to?

As already was pointed out, you have to map UI event parameters like TableColumn.onAction.col to action handler parameters to use them in the action handler.

Other remark: In your code, you access UI elements from within event handlers, this is not allowed.

Armin

former_member182372
Active Contributor
0 Kudos

Hello Mahesh,

wdEvent.getString("col") should contain column ID. Did you call column.mappingOfOnAction().addSourceMapping("col", "col"); for every table column?

Best regards, Maksim Rashchynski.