cancel
Showing results for 
Search instead for 
Did you mean: 

setVisibility throws NullPointerExeption ?!?

Former Member
0 Kudos

In my webdynpro application I have to set a visibility property on a table. But I always get a NullPointerExeption. Hier is my coding:

wdContext.currentLocalElement().setDebTabVis(WDVisibility.BLANK);

- The type of my context variable is com.sap.ide.webdynpro.uielementdefinitions.Visibility

- The properties calulated and readOnly are both false

- On an other view in my application I have the same process and in this view works the method

Can anyone help me? I don't understand this.

Thangs a lot. Nicole

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

The expression wdContext.currentLocalElement() is NULL. The node "Local" either contains no element or the lead selection of this node is not set.

Armin

suresh_krishnamoorthy
Active Contributor
0 Kudos

Hi Nicole,

do you have value attribute under value Node(Local) like this.

-Local

-DebTabVis(com.sap.ide.webdynpro.uielementdefinitions.Visibility)

wdContext.currentLocalElement().setDebTabVis(WDVisibility.BLANK);

Regards, Suresh KB

Former Member
0 Kudos

Hi Suresh,

thanks for your interesting in my problem. Yes, you're right. I have a value Node names local and an value attribute called debTabVis.

It's a visibility attribute for a smal table.

Former Member
0 Kudos

Hello Armin,

thanks for your help. My node "local" has one element called debTabVis but I'll will try to set the lead selection.

Nicole

Former Member
0 Kudos

Hi

Create the visibility element debTabVis under the root context node and set the visibility in the required method

wdContext.currentContextElement.setDebTabVis(WDVisibility.BLANK);

or

Set the cardinality of the node Local to 1..n and try with the same code u have given.

- Rathna

Former Member
0 Kudos

Hi Rathna, your note to set the right cardinality was very helpfull. Thaks for your help.

Nicole

Former Member
0 Kudos

But: What you probably really want is cardinality 1:1 and selection 1:1. This automatically ensures that there always exists exactly one node element and it is always selected (see my earlier post).

Armin

Answers (0)