Power of Input Element Property of a Context Node
So I directly go ahead and discuss the Context Mapping types:
Internal Mapping:It is the Context Mapping that is done between different controllers of the same component. Here please note the controllers can be any one among the component controller, configuration controller, window controller, view controller, custom controller but not the interfacecontroller.
External Mapping:Context Mapping done between the controllers of different components to share data. Here the interface controller comes into picture.
External Mapping is further of two types:
Direct Context Mapping:Passing data from the child component to the parent component, which normally is the reason in which we use other components in our component. In this case mapping origin( the data source )is the Interface Controller of the child component.
Note: Here I am using the terminology as child component and parent component, just to make it a bit simple. By child component I mean the component that is being reused, or component whose component usage has been declared in some other component. Parent component is one which has the usage defined in itself, or which uses the other component. In this case the lifetime of the instance of the child component is of importance, as it should be present to transfer the data to the parent.Deleting the instance means that the mapping origin would not be available.
Reverse Context Mapping:Passing data from the parent component to the child component. In this case mapping origin is the ComponentController of the parent component.
Now by setting up the basic platform, I would like to share some knowledge across regarding the reverse context mapping or in a way to transfer data from parent to child.>In the child component I want the data to come from the parent in the node CUSTOMER of the child.
This picture below displays us the layout of the child which has just one view embedded in the window.
Below displayed screenshot, shows the context of the component controller of the parent component. Notice here also we have a node CUSTOMER, and there is NO need to check the Interface Node property or either the Input Element property of the node.
After declaring the usage of the child component in the parent component and defining the navigation( Inbound and Outbound Plugs along with the Navigation links) we fill the node CUSTOMER. The screen shot below shows the usage of the child component declared. Since it is required to navigate from the parent component to child component , so the window of the child component has to be embedded in the parent comp window, along with the necessary plugs. Screen shot below displays that.
The condition to fill the node may vary from program to program. In this case on changing the lead selection of the Bookings Table I am calling an action handler method through which I am calling a component controller method CUSTOMER_FILL to fill the node CUSTOMER. (this is done to segregate the business logic from the User Interface, MVC Concept, No business logic in View Controller)
As you integrate the child component, something known as Component Usages is created in the left hand side of the window as depicted in the screen shot. Now under the usage of the child component the usage of the interface controller of the child component has to be declared, as it has the node, methods, events to be shared across the components. Once this is done, then it must be told that which is the controller with which the data is to be shared, or in other words the controller used has to be declared. In the screen shot below Component controller of the parent component is the controller used in the interface controller usage and acts as the mapping origin. Now the mapping is defined for the Interface controller node ( CUSTOMER ) with the Component Controller Node ( Customer ), which is this happens to be known as Reverse Context Maping.
In the screen shot below the data of the node CUSTOMER is read in the wddoinit method of the component controller, just to check that wheather the data is coming or not.
This screenshot above displays that the child has the dataa and can now process the data and diplay it. Since the child’s window is embedded in parent and window has customer view as default view, it is dispayed. The final output is displayed as follows.The customer view comes below the bookings table data as the view has been embedded in the ViewElementUiCcontainer