cancel
Showing results for 
Search instead for 
Did you mean: 

wd_this and if_componentcontroller ?

Former Member
0 Kudos

hi friends...

I am new to WDA, can you explain me the followings...

l_node = wd_context->get_child_node( wd_this->wdctx_node_1 ).

and

l_node = wd_context->get_child_node( name = if_componentcontroller =>wdctx_node_1 ).

i hope both statements are same purpose to get the child node within the root node...

and wdctx_node_1 is the constant which holding the node name.

in the first statement, wd_this->wdctx_node_1 what this mean ? here wd_this means what ?

in the second statement, if_componentcontroller =>wdctx_node_1 what this mean ? here if_componentcontroller means what ?

and why we are using -> symbol in 1st statement and => symbol in 2nd statement ?

what is the difference between both...?

kindly explain me in detail...

By

Deva

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi ,

Here the wd_this refers that it is pointing or refreing to the present controller reference .

eg: when you find the code using the wd_this which means it is pointing or refering to that particular view or to that context or so on.... which means this or self refrence concept in classes.

Next coming to the concept of if_componentcontroller which means that it is the refrence of the component controller but both the peice of code serves the same purpose .

here -> symbol refers that it is an instance method of this controller.

and => refers that it is the static method of that controller or context .

in your webdynrpo component open the method where u have written the code and in the application tool bar you can find the button called Display controller interface there you can find the code and find the difference of these two kinds .

GoodDay .

Regards,

Sana.

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi

wd_this->wdctx_node_1 implies you are referrring the context node in your view.

if_componentcontroller =>wdctx_node_1 you are referring the same node from context controller , by this the node would be accessed in other views as well

I hope it would help

Former Member
0 Kudos

Hi,

wd_this->wdctx_node_1 represents that u r accessing the node of view context i.e. which is binded to the vioew.

if_componentcontroller =>wdctx_node_1 represents that u are acccessing the node of component controller.

-> refers to instance method.

=> refers to static method.

Former Member
0 Kudos

hi,

chk out this link .

https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/60730016-dbba-2a10-8f96-9754a865...

i hope it will help you to have a clear understanding.

Thanx.

Former Member
0 Kudos

Hi Deva,

Both the statements are correct.

wd_this->wdctx_node_1 ---> means it is refering the node which is binded to your view.

here wd_this means reference to your view.

if_componentcontroller =>wdctx_node_1 -


> means it is refering the same node but from controller.

if_componentcontroller means controller reference.

You mapped and binded the node of component controller to view controller context. So you can use either of them