cancel
Showing results for 
Search instead for 
Did you mean: 

How can we access the context of Parent's Component Controller

Former Member
0 Kudos

Good day,

I have 3 components named MainComp, TaskComp and ObjectComp.

TaskComp has context node 'Tasks' and view 'TaskView'.

ObjectComp has context node 'Objects' and view 'ObjectView'. They both are defined as interface nodes.

Both TaskComp and ObjectComp are being defined as Used Component in MainComp and so their nodes are mapped to the context of MainComp, so now MainComp also have two context nodes Tasks and Objects.  The views TaskView and ObjectView of the components TaskComp and ObjectComp has also been embedded in the window of MainComp. Now Table element is used to enter the data in the both TaskView and ObjectView which are bound to nodes 'Tasks' and 'Objects' so data are being populated in them. Now I want to access the context node Objects in method of TaskComp i.e. I want to access Parent's(MainComp) Component Context Nodes in TaskComp method. Can someone please help me out by mentioning the code needed to access the parent's component context. Is it also possible to access directly the context 'Objects' using ObjectComp instead of MainComp, if it is, then please also do mention the code required.

Thanks and Regards,

Talha

Accepted Solutions (1)

Accepted Solutions (1)

former_member184578
Active Contributor
0 Kudos

Hi,

Map the MainComp Component controller context node to the Interface Controller context node of Used Components. Then the data will be shared in the used components context node.

Or,

Create a Singleton class and set the context data in MainComp and access it in used components.

Regards,

Kiran

Former Member
0 Kudos

Thanks Kiran. As 'Objects' context node is already mapped from the Usage Component ObjectComp to MainComp. Now I want this 'Objects' context node also available to TaskComp which is also defined as Usage Component in MainComp. Now when I am trying to may Objects context node to context node of TaskComp it is not allowing because of the reason that mapping is already made on Object context node from ObjectComp to MainComp, so I cannot map it again from MainComp to TaskComp. Let me know if I am doing anything wrong else I then try to use Singleton tecnhnique.

Regards,

Talha

former_member184578
Active Contributor
0 Kudos

Hi,

You cannot map two context nodes to the same node. Try create a new Context node(of same attributes) in Component controller of MainComp and then map the 2nd component usage context to that. Or you can use singleton class to share the context node data across components.

hope this helps u,

Regards,

Kiran

Answers (0)