cancel
Showing results for 
Search instead for 
Did you mean: 

NullPointerException when initializing table node attributes.

Former Member
0 Kudos

Hello there,

I am getting NullPointerException when I am initializing the table node attributes in the wdInit() method of the component controller.

This node is mapped to table node in the view context,

wdContext.currentTableNodeElement().setAttribute("attr");

Cardinality: 0..n

Selection: 0..1

Can we manually initialize mapped table node attributes in the wdInit() of component controller?

Thanks

Srinivas

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

hi,

use th following link,

https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/4a417a90-0201-0010-f499-8d41fc78...

In this example check out the code in page 42.

value node : quizdata

value attibutes: question.answer,counter.

1. In the for loop populate the value attributes under the value node

2. den v bind the collection of context node elements to context value node

wdContext.nodeQuizData().bind(questions);

And regarding the cardinality it is as you have used 0 : n

Regards

Jayapriya

Former Member
0 Kudos

Thanks a lot for the helpful document!!!

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Srinivas,

For assigning a value to the table element you need to do it as following:

IPrivate<View Name>View.I<Node name>Element element=wdContext.node<Node name>.create<Node Name>Element();

element.set<Attribute Name>("String");

wdContext.node<Node Name>.bind(element);

This way you can do what you want.

Regards.

Rajat