cancel
Showing results for 
Search instead for 
Did you mean: 

WD JAVA : ContextMenu Checkbox item

Former Member
0 Kudos

Hi,

Can someone please explain or share some source for creating ContextMenu having Checkboxes

Regards,
Sam

Accepted Solutions (1)

Accepted Solutions (1)

govardan_raj
Contributor
0 Kudos

hi samba ,

can u please breifly explain what you wanted  ..... ? Im not able to understand your requirement.

Regards

Govardan Raj

Former Member
0 Kudos

Hi Govardan,

I am just trying to display a Context Menu with CheckBox items as shown below

But am getting the below error while selecting the checkboxes.

Caused by: java.lang.NullPointerException: while trying to invoke the method com.sap.tc.webdynpro.progmodel.context.AttributePointer.getElement() of a null object loaded from local variable 'property'

  at com.sap.tc.webdynpro.progmodel.view.SecureInteractionHelper.updateAttribute(SecureInteractionHelper.java:153)

  at com.sap.tc.webdynpro.progmodel.view.SecureInteractionHelper.updateAttribute(SecureInteractionHelper.java:136)

  at com.sap.tc.webdynpro.clientserver.uielements.adaptbase.AbstractAdapter.updateAttributeAsKey(AbstractAdapter.java:1433)

  at com.sap.tc.webdynpro.clientserver.uielib.standard.uradapter.MenuCheckBoxAdapter.onSelect(MenuCheckBoxAdapter.java:738)

  at com.sap.tc.webdynpro.clientserver.uielib.standard.uradapter.MenuCheckBoxAdapter.onPOPUPMENUITEMSELECT(MenuCheckBoxAdapter.java:727)

  at com.sap.tc.webdynpro.clientserver.uielib.standard.uradapter.MenuAdapter.onPOPUPMENUITEMSELECT(MenuAdapter.java:826)

Could you please help me.

Cheers,
Samba

govardan_raj
Contributor
0 Kudos

Hi samba,

your error shows that there is java.lang.null pointer exception...

i.e you are trying to access a node with cardinality 0...n and which does not have elements in it.

so try to fix that issue , it wil solve your problem,  another thing is on click of select

put the below code

if(null != wcontext.currentcontextelement().getxxx())

{

    your code to do if check box is selected

}

Regards

Govardan Raj

Former Member
0 Kudos

Hi Govardan,

Yes, It is because of cardinality.. It is fine now.

Thankss

Cheers,

Samba

govardan_raj
Contributor
0 Kudos

Hi samba,

Nice to hear that your problem is solved.

Most welcome

Regards

Govardan Raj

Answers (0)