cancel
Showing results for 
Search instead for 
Did you mean: 

How to get value from one context node to another context node in different views

Former Member
0 Kudos

Hi gurus

I have the following problem.

I have 2 context nodes (context node1 and context node2) in views different. the context node1 is bound to the component controller.

I need get a data from context node1 in the getter_method of an attribute from context node2.

I know how to get a reference to the component controller,you can do it as follows.

lr_controller TYPE REF TO CL_BUD_BSPWDCOMPONEN_IMPL "Implementation class of the component controller

lr_controller ?= me->comp_controller.

but the Access to protected attribute "COMP_CONTROLLER" is not possible.

Can you help me telling me how do I read the data of the context node 1 from the method of the attribute in the context node 2

Regards,

Felipe Grajales

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Dear Felipe,

  One of the step to access component controller form CNXX class is

           Create reference attribute of type component controller in CNXX class

           say GR_COCO type ref to (component controller )

           Then assign it in DO_PREPARE_OUTPUT.

               me->typed_context->(NODE)->GR_COCO ?= me->comp_controller.

 

Now you can read your Component controller form your getter or setter method.

Thanks and Regards

Rajarama U

Answers (2)

Answers (2)

Former Member
0 Kudos

HI Felipe ,

Have a look at this thread http://scn.sap.com/thread/3194920.

Regards,

Nithish

former_member184067
Active Contributor
0 Kudos

Hi Felipe,

is the value of context node that you want to get is from a model context node or value context node?

if it is from a model context node, it may be able to be accessed from root and using bol relation

you can go the root by using method get_root(). after that you can get access to its child using method get_related_entity( ).

hopes it helps

cheers

eddhie kurnianto