on 12-09-2014 9:20 AM
Hi all,
In view, we can see WD_CONTEXT which is TYPE REF TO IF_WD_CONTEXT_NODE.
In IF_WD_CONTEXT_NODE-GET_CHILD_NODE, we can see parameter CHILD_NODE is also TYPE REF TO IF_WD_CONTEXT_NODE.
I tried to use WD_CONTEXT directly when I want to get the value of the element like WD_CONTEXT->GET_CHILD_NODE(but this is wrong).
Could anyone tell me what exactly is WD_CONTEXT&CHILD_NODE?
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.
Ex:- The controller context contains the MY_NODE1 node.
data: TABLE_NODE type ref to IF_WD_CONTEXT_NODE.
TABLE_NODE = WD_CONTEXT->GET_CHILD_NODE( 'MY_NODE1').
Hope this helps you.Pls revert for further clarifications.
Thanks
KH
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ming,
The CONTEXT is root node and it can have as many attributes and child nodes inside.
By default, every controller has the reference to CONTEXT initialized in attributes tab and created the attribute WD_CONTEXT of type ref to IF_WD_CONTEXT_NODE.
But, to access, any of its attributes or child nodes, we need to use the WD_CONTEXT object and using methods GET_ATTRIBUTE / get_child_node( ) we get the components of root context.
Similarly, child node MY_NODE1 can have as many as child nodes under it.
Regards,
Rama
Hi, I have checked the code of 'CL_WDR_CONTEXT_ELEMENT' in which 'IF_WD_CONTEXT_ELEMENT' is defined.
It seems that when you create a node like 'NODE1' in the view.
Based on code, the system creates a node object, this object has two parameters which are node name and node object reference(meanly it's address). They are appended to an internal table.
When you use GET_CHILD_NODE, the system will search the internal table and find the object reference according to the node name.
And no matter at which level the nodes are, they are not allowed to have the same name.
It means that you cannot define a NODE1 under a NODE1. I think that based on the source code, the nodes do not have levels.
wd_context is just a reference to you ROOT node
If you have attributes directly in root - context (without any node) you can get These values wie wd_context->get_attribute
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
89 | |
10 | |
9 | |
9 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.