cancel
Showing results for 
Search instead for 
Did you mean: 

access component control node from view controller

former_member184741
Active Contributor
0 Kudos

hi Experts,

i have a node in component controller. i want to access that in some method in view controller. please note that i do not want to do mapping. they are separate nodes. i want to read/set the node of component controller from view controller methods. is this possible? if yes can somebody give the sample code?

thanks

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

It is possible to read/set node at component controller level from view level.

1.Get component controller API

lo_component             = wd_comp_controller->wd_get_api( ). (lo_component type ref if_wd_component)

2.Get controller context node :

lo_controller ?= lo_component. (lo_controller type ref to if_wd_controller)

lo_controller->get_context.

4.Get root node of component controller

5.Get child node

And then you can use get_static_attributes_table or set to bind data.

Thanks

Bhanu Malik

Answers (2)

Answers (2)

ajoy_chakraborty
Participant
0 Kudos

hi,

you can create a method under COMPONENT CONTROLLER -> Method tab and refer it using:

wd_comp_controller-><method name( )>

Write the functionality inside the method created

Regards,

Ajoy

Former Member
0 Kudos

1 Create a method in component controller as read_node with relevant parameters to be exported.

2 In this method, read the node and retrieve the data and you can either pass data to those exporting parameters or create relevant variables under attributes tab of component controller so that you can globally use them and pass data to these attributes eg temp type I.

3 In the view method, you can use the below code

variable = wd_comp_controller->read_node( ).  "if exporting parameters declared

or

you can directly use the global variable declared like this

wd_comp_controller->temp.

former_member199125
Active Contributor
0 Kudos

Lekha,

Grt, its very simple idea....

Regards

Srinivas