cancel
Showing results for 
Search instead for 
Did you mean: 

null pointer in table sorter

Former Member
0 Kudos

Hello

I have a null pointer message for a table sorter.

I am working on SP13.

I included the TableSorter file in my project, I created a value attribute 'Sort_SelectedProductGroup' with type TableSorter, and created an action 'SortSelectedProductGroup'.

I have the following code for ModifyView:

if (firstTime)

{IWDTable table = (IWDTable) view.getElement("Table_0_1_2_3");

wdContext.currentContextElement().setSort_SelectedProductGroup(

new TableSorter(table,wdThis.wdGetSortSelectedProductGroupAction(), null));}

The short dump is in Sort action, the code for that is:

wdContext.currentContextElement().getSort_SelectedProductGroup().sort(wdEvent, wdContext.nodeI_T006());

The trace is:

java.lang.NullPointerException

at com.cgi.assignumtoproductgroup.AssignUMToProductGroupView.onActionSortSelectedProductGroup(AssignUMToProductGroupView.java:467)

at com.cgi.assignumtoproductgroup.wdp.InternalAssignUMToProductGroupView.wdInvokeEventHandler(InternalAssignUMToProductGroupView.java:487)

at com.sap.tc.webdynpro.progmodel.generation.DelegatingView.invokeEventHandler(DelegatingView.java:87)

at com.sap.tc.webdynpro.progmodel.controller.Action.fire(Action.java:67)

at com.sap.tc.webdynpro.clientserver.task.WebDynproMainTask.handleAction(WebDynproMainTask.java:101)

at com.sap.tc.webdynpro.clientserver.task.WebDynproMainTask.handleActionEvent(WebDynproMainTask.java:304)

at com.sap.tc.webdynpro.clientserver.task.WebDynproMainTask.execute(WebDynproMainTask.java:649)

at com.sap.tc.webdynpro.clientserver.cal.AbstractClient.executeTasks(AbstractClient.java:59)

at com.sap.tc.webdynpro.clientserver.cal.ClientManager.doProcessing(ClientManager.java:248)

Any ideea about what is wrong there?

Thank you

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Can you please post the <b>complete </b>content of

- method wdDoModifyView()

- the action handler for "SortSelectedProductGroup"

Armin

former_member182372
Active Contributor
0 Kudos

Hi Georgeta,

It looks really strange because in code

wdContext.currentContextElement().getSort_SelectedProductGroup().sort(wdEvent, wdContext.nodeI_T006());

NPE can be caused only when: wdContext is null (if it is true then it is WD runtime bug), wdContext.currentContextElement() is null (same), wdContext.currentContextElement().getSort_SelectedProductGroup() (by some reasons attribute is not set in wdDoModifyView). Can you set the breakpoint in action handler and check what exactly is null. Or print values mentioned above using Messagemanager on the scereen.

Best regards, Maksim Rashchynski.