Monday, 9 July 2012

WD_USAGE_INITIALIZE

Data Exchange between UI Components
Consider the Scenario where Component 'A'  is the Embedding Component & Component 'B' is the Embedded Component. (i.e B resides in A).
In Component B 
Goto the Runtime Repository Editor
Expand Component Interface
Under Interface Controller
Right click on the context and add the context node (Say 'PARTNER').
(We need to do this as we have to expose the context node( here say 'PARTNER' ) of the component controller of UI Component B to be used in Component A).
Save
*********************************************************************************
In Component A
Goto the Runtime Repository Editor
Goto Component Usage Right Click and add Component usage
(i.e Used Component = UI Component 'B' & Interface View = Main Window).
Save
*********************************************************************************
Now implement the 'WD_USAGE_INITIALIZE' method in the Component Controller of the Embedding Component i.e Component 'A'.

CASE iv_usage->usage_name.
When 'B.'   ................." Here the Component Usage 'B'.
    iv_usage->bind_context_node
    exporting
iv_controller_type =  cl_bsp_wd_controller=>co_type_component
iv_target_node_name = "PARTNER"
iv_node_2_bind = "PARTNER".

Note: You can also Bind the Interface Controller context node with the Custom Controller of an Embedding Component (i.e in our case it is UI Component 'A'). The above Scenario discusses the { Component Controller(A)<-->Component Controller(B) }Binding . Let us See the case
Custom Controller(A)<-->Component Controller(B)}



CASE iv_usage->usage_name.
When 'B.'   ................." Here the Component Usage 'B'.
    iv_usage->bind_context_node
    exporting
iv_controller_type =  cl_bsp_wd_controller=>co_type_custom
iv_target_node_name = "PARTNER"
iv_name =  'Name of the custom controller in component A'
iv_node_2_bind = "PARTNER".

----<<<<@@@@@There Ends the Binding@@@@@>>>>---------



     

No comments:

Post a Comment