cancel
Showing results for 
Search instead for 
Did you mean: 

DropDownByIndex Null pointer Exception

Former Member
0 Kudos

Hi all,

Im have a DropDownByIndex UI element which is bound to a model node. The data in the Drop Drown is getting populated correctly.

I am trying to pass the selected data to the backend using the following line:

input.setPo_Region(wdContext.nodeLi_Pricing_Region().currentLi_Pricing_RegionElement().getBzirk());

where Li_Pricing_Region is the node to which I have bound the DropDownByIndex UI Element. I have written this in the Init() method.

But I am getting a Null Pointer Exception.

Can anyone help me out?

Thanks in advance,

Reena

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Check the size of the node.

Since its bound to a model node,is data available in model node in wdDOInit itself ? I doubt it

Make sure that the model node data which is bound to dropdown is available by checking the size or displaying it in a table.

Regards

Bharathwaj

Former Member
0 Kudos

Hi Bharathwaj,

This was precisely the problem.

Thanks a lot. Its solved now.

I have another query if you could kindly help me out.

When I make a selection in the drop down and click on a button, the correct value is sent to the backend, but the value displayed in the drop down field reverts back to the first entry in the list. I want the value selected by the user to remain.

How can I achieve this?

Thanks in advance,

Reena

Former Member
0 Kudos

The selected entry is always the lead-selected node element, so you probably reset the lead selection to the first index.

Armin

Former Member
0 Kudos

Hi ,

This might be because you are invalidating this node also after the execution of the model.

You can invalidate the output node alone or store the index of the selected element before invalidating and manually set the lead selection to the same index after the execution of RFC.

Regards

Bharathwaj

Former Member
0 Kudos

Hi,

I was able to solve the problem.

Thanks a lot.

Regards,

Reena

Answers (1)

Answers (1)

Former Member
0 Kudos

Check if the lead selection of node Li_Pricing_Region is IWDNode.NO_SELECTION aka -1.

Armin