cancel
Showing results for 
Search instead for 
Did you mean: 

wd_context

former_member185241
Active Participant
0 Kudos

Hi Experts ,

What is  wd_context and where to use wd_context?

Thanks and Regards
Abhishek Kumar

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

The WD_CONTEXT attribute is a reference to the root node of the context of the controller. 

Regardless of the edited controller, it is always a reference variable of the type

IF_WD_CONTEXT_NODE. You can use WD_CONTEXT and the interface methods to

edit the content of a context node in your controller method.

For Example 

The controller context contains the TABLE_NODE node. You can use the INVALIDATE

method to invalidate the values of the node elements.

method INVALIDATE_TABLE_NODE . 

data: TABLE_NODE type ref to IF_WD_CONTEXT_NODE.

TABLE_NODE = WD_CONTEXT->GET_CHILD_NODE( 'MY_TABLE_NODE' ).

TABLE_NODE->INVALIDATE( ).

endmethod.

Answers (2)

Answers (2)

former_member185241
Active Participant
0 Kudos

Thanks to all i got the concept

sudarmanikandan
Explorer
0 Kudos

Hi,

I would like to add some more points to Harsith's comments.

The WDA framework itself declare a variable called WD_CONTEXT in the attributes. It refers to the root node of the corresponding controller. For eg. WD_CONTEXT in Componenent controller refers to the root node in Component Controller and WD_CONTEXT in View Controller refers to Root Node in View Controller. When you define a node in View, it can be accessible in View Controller methods only. A Constant will be created in Controller Interface whenever you are defining a node.

The root node has a interface which is IF_WD_CONTEXT. It has some public method which will be accessible by the controller methods and the context has a property called Lead_Selection, if you make it as marked, then the element of the node will always be set as lead selected.

Hope this helps !!!

Thanks,

Sudar