cancel
Showing results for 
Search instead for 
Did you mean: 

Node

Former Member
0 Kudos

component controller -

Visibility (Node)

--->ExcelVisible (Value Attribute)

I created a Node Visibility and underneath is ExcelVisible attribute

and link to the view and i bind my code to container ,

it throws null pointer exception


wdContext.currentVisibilityElement().setExcelVisible(WDVisibility.NONE);

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi First create an element of the Visibility element linke the following...

wdContext.nodeVisibility.addElement(wdContext.nodeVisibility.createElement).

and then use your as you have written.

It is giving null pointer because the cardinality of the VIsiblity element is 0....to n and without creating elemnt you are trying to access currentVisibility element.

Thanks and Regards

Avijit

Former Member
0 Kudos

thanks a lot for giving this info

if it would be better if i change the cardinality 1..1

so i dont need to add this line

wdContext.nodeVisibility.addElement(wdContext.nodeVisibility.createElement)

Message was edited by:

yzme yzme

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi,

Make sure the "excelVisible" value attribute is of type: <i>com.sap.ide.webdynpro.uielementdefinitions.Visibility</i>

Besides, where did you type your code?, in the OnAction of a button,etc or in the DoInit() of that view?

If the visibility is not getting set in the doInit() of that view, but its value is getting called, then it might result in null pointer exception.

Make sure, the value attribute, has some value, under all circumstances, by giving it some default value in doInit() of that view.

Regards,

Hanoz

Former Member
0 Kudos

Hi Yzme,

Ur currentVisibiliElement is not initialized i think.Can u send the complete code u have written for this method,so that we can try to solve it.

regards

Sumit

former_member751941
Active Contributor
0 Kudos

Hi yzme,

Dont take any node Like "Visibility".Just take a context attribute say "ExcelVisible" of type "com.sap.ide.webdynpro.uielementdefinitions.Visibility".

In layout of the view property "visibily" value bind "ExcelVisible" and then in side the "wdDoModifyView" use this code.

wdContext.currentContextElement().setExcelVisible(WDVisibility.BLANK);

Regards,

Mithu

Former Member
0 Kudos