cancel
Showing results for 
Search instead for 
Did you mean: 

unable to access context attribute from wdDoInit()

Former Member
0 Kudos

Hi,

I am trying to access the context attribute and assign value to it inside wdDoInit() of the iView. But when i deploy and execute it is saying " Null pointer exception". Please help me.

Code

wdContext.currentInfoElement().setFirstName("Raghu");

Edited by: Raghunathan Mohan on Nov 19, 2008 9:06 AM

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

wdContext.currentInfoElement().setFirstName("Raghu");

from the above statement i think the node "Info" cardinality is 0...n ,change the cardinality to 1..1 or 1..n.

Regards,

ramesh

Former Member
0 Kudos

Hi Ramesh,

My problem is solved . After changing the cardinality it works fine.

Thanks,

Raghu.

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

As per above post please check cardinality to be 1..n or 1..1 (if you want only one node instance). You should instantiate the node first then only you can have the elements.

Can you provide the previous lines of code, which could be checked?

Regards,

Anagha

Former Member
0 Kudos

Hi,

Did you create element for the info node? If not please create it. If you dont have any element then how can you access its attributes.

Hope it helps.

Cheers,

Manoj

Former Member
0 Kudos

I have already created the node Info. After changing the cardinality it works fine.

Edited by: Raghunathan Mohan on Nov 20, 2008 5:48 AM