on 07-19-2008 3:12 PM
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 ?
In your code you create both table sorter instances for the first table ("tab").
Armin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.