cancel
Showing results for 
Search instead for 
Did you mean: 

currentContextElement() : Why ????

Joseph_BERTHE
Active Contributor
0 Kudos

Hello,

I'm using Web Dynpro since few days, and I wondering, why should I use :

<b>wdContext.currentContextElement().setMyVariable()</b> to access to a context

and not :

<b>wdContext.setMyVariable()</b>

I really don't understand the logic of that. Is it possible to have more than one context for a view for instance ?

Regards,

Accepted Solutions (1)

Accepted Solutions (1)

pravesh_verma
Active Contributor
0 Kudos

Hi Berthe,

The wdContext.currentContextElement() is used so as to make sure that you are directly accessing the Context Node and can access the attributes which are directly under this node.

If for example you have created another node, say "<b>Temp</b>" then you will be having a extra method to call named: <b>currentTempElement()</b>, which will make sure that you are setting only the values of the Temp Node, not any other node.

<b>>>Is it possible to have more than one context for a view for instance ?</b>

No, there will be only one context node for a particular view.

I hope this helps you and solves your problem.

Regards

Pravesh

Joseph_BERTHE
Active Contributor
0 Kudos

Hi,

Ok, I think I understood. But how can I create a node ?

Regards,

pravesh_verma
Active Contributor
0 Kudos

Hi Berthe,

...?? Hey!! Do you want to know how to create a new Node.. I mean its very simple, if you are asking that.

Just go to the Context Node and right Click it. There will be an option for <b>New -> Node.</b>

I hope this is what you were asking..

Regards

Pravesh

PS: Please consider rewarding points if helpful.

Joseph_BERTHE
Active Contributor
0 Kudos

Hi,

Thank you, I understand.

Regards

Answers (0)