cancel
Showing results for 
Search instead for 
Did you mean: 

Table Sorting

Former Member
0 Kudos

hi

iam performing table sorting on the model node

and first table its working fine , but when iam trying to sort

the second table its throwing null pointer exception

in the action method .

if(firstTime)

{

view.nowCreateAllCustomExtensionFields();

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

IWDTable tabCarv=(IWDTable)view.getElement("tbl_carv");

wdContext.currentContextElement().setCarTableSorter(new TableSorter(tab,wdThis.wdGetCarTableSorterAction(),null));

wdContext.currentContextElement().setCarvTableSorter(new TableSorter(tab,wdThis.wdGetGetTableSorterAction(),null));

}

i have written the above code and then created

two action methods

first action method

wdContext.currentContextElement().getCarTableSorter().sort(wdEvent,wdContext.nodeIt_Car_Data())

second action method

wdContext.currentContextElement().getCarTableSorter().sort(wdEvent,wdContext.nodeIt_Carv_Data());

and two context variable of type TableSorter

is throwing NULL pointer exception for the second table action when iam trying to sort.

can any one help me out ?

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

In your code you create both table sorter instances for the first table ("tab").

Armin

Former Member
0 Kudos

hi

thanks for ur reply ,

got the problem solved with the condition as

if(null!=node_it_Carv_Data)

{

}

thanks for the help .

PradeepBondla
Active Contributor
0 Kudos

Hi Kishore,

Try what manoj suggested, if still getting problem.

try another way of sorting, check the code what velery suggested in below post

this is for your info

Regards,

Pradeep

Former Member
0 Kudos

Hi,

Just add the condition as follows:


if(null != wdContext.nodeIt_Carv_Data()) {
         wdContext.currentContextElement().getCarTableSorter().sort(wdEvent,wdContext.nodeIt_Carv_Data());

}

The same thing i did as i got the NPE when there was no data in the node.

Hope this helps.

thanks & regards,

Manoj