cancel
Showing results for 
Search instead for 
Did you mean: 

if_wd_context_node&if_wd_context_element

Former Member
0 Kudos

Hi all,

I am a beginner of WDA, I am following some guides to build an easy WDA application.

I noticed that some tutorials use if_wd_context_element.

But in ATTRIBUTE tab of VIEW, you cannot find if_wd_context_element but if_wd_context_node.

And if_wd_context_node also has the methods like GET_ATTRIBUTE.

I have tried both and both of the two objects work correctly.

My question is:

Is this if_wd_context_element used for the old version of WDA and it may be not used now?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

In case of a Node with only one Element, it doesn't matter which class (node/element) you're using, but if you have a node with 0..n elements, you have to get the specific element.

I take always the element class, because it's something "clearer" than using the node class.

Former Member
0 Kudos

I have tried this and it is like what you said.

BTW, can you tell me where I can find if_wd_context_element.?

It should be defined somewhere in the web dynpro component.

ramakrishnappa
Active Contributor
0 Kudos

Hi Ming,

If_wd_context_element is no where defined in component but its an interface used at runtime to read the context element reference of context node and is also used to get node's attributes.

Comparison:

Context node: is like table

Context element: is like a row/record in it

Attribute : is like a field

A context node can have as many as context elements inside it.

DD:   From table ---> you get many rows/records  ---> from each work area you can access fields

WD : From context node ----> you get the context elements ---> from each context element you can access attributes

Please refer to my answer in the below link

Hope this helps you in understanding concept.

Regards,

Rama

Former Member
0 Kudos

Thank you.

I think I got it.

If_wd_context_element is a globally defined interface.

And so is If_wd_context_node.

wd_context is just ref to If_wd_context_node.

ramakrishnappa
Active Contributor
0 Kudos

Hi Ming,

Please close the discussion by marking replies as correct / helpful answers if those helped you in understanding concept.

Regards,

Rama

Former Member
0 Kudos

OK, I will.

Thank you for your remind.

Answers (2)

Answers (2)

rajeshkothamasu
Active Participant
0 Kudos
Former Member
0 Kudos

The context is as the picture showed, and it seems I can use both if_wd_context_element but if_wd_context_node to get the ATTR1.