
Summary
This documnet includes demonstration of how to integrate two Web DynPro Java components and call other DC’s method.
This way we can create a development component for common functionality and call it in multiple DCs.
Introduction
In DC integration we use component from different DC and call its methods, we can use its contexts and get the value of context in other DC. By integrating DC , we can truly implement the reusability of components in projects. For common functionalities/Screens that needs to be called in multiple applications, we can use DC integration.
We need two Wed DynPro components.
Create a new Web Dynpro DC named firstdc with the component named FirstDcComp and the application named FirstDcApp. Let the window be named FirsctDcWin and its view FirstDcView.
Create another Web Dynpro DC named seconddc with the component named SecondDcComp and the application named SecondDcApp. Let the window be named SecondDcWin and its view SecondDcView.
In SecondDc:
Create a method in component controller
In the method of component controller write some code: (Here i am printing text)
Copy the method of component controller and paste in interface controller. By doing this step we expose method so that other dc can call it.
Similar way, we can expose context of componet as well so that they can be refered in other component
Go to component properties of second dc -> public Parts tab
Add public part
Give proper name to the public part and click on Finish.
Right click on public part and select manage entities to add seconDcComp Component in public part.
You will get the following screen. Select component to be exposed.
And Finish.
Go to component properties of firstdc
Add dependency of seconddc
Click finish.
Right click on Used component and add secondDcComp
Give name to component to be used and Finish
We create a button and its event on FirstDcView
Go to firstDcWindow and embed interface view of secondDc so that u can call seconDcView and event of secondDc
In firstDc,
On button event we call method of secondComp
To call method from secondComp ointerface controller we need to add reference of it in the view
After building and deploying application, we run the firstDcApp application
on click of button, method from secondDcComp will be called as per the code. And we have printed test in the method m_callOk()
So, we get the result as
Using this method we can create reusble componments for common processes. One DC can be used multiple times in different DCs this will reduce the development efforts.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
21 | |
18 | |
10 | |
9 | |
7 | |
7 | |
7 | |
6 | |
5 | |
5 |