cancel
Showing results for 
Search instead for 
Did you mean: 

how to implement data's transmission between two components?

Former Member
0 Kudos

HI All:

I want to transport data from one component to another like this:

first,i created an application with a component.a iview in it.

in the iview,i created a table for displaying data which come from database.

now i just want to do like this:when i click the record of the table,i want to open a new IE window to display the detail message of the record.

of course,i had mapped the contexts between them throw using Component Interface.

Maybe i described my question not exactly,i repeat again:

when i click the record,what can i do for transporting this record's data to another component which is to display the detail of this record...

Thanks advanced...

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

Hi,

Expose your context attributes by Interface controller in the source

In the target acccess this DC

map this context to respective controller->view

Create Ui components binding to this context.

Regards

Ayyapparaj

Former Member
0 Kudos

Hi,

There are two ways:-

1>create one component,in that create two window, per window one view will be there. in that case you can call 2nd window's view from the 1st window view as external window (pop-up) and you can pass parameter also. for that sample code is:-

IWDWindowInfo info =

wdComponentAPI.getComponentInfo().findInWindows(

"Win_WinAppSecnd");

IWDWindow win_error =

wdComponentAPI.getWindowManager().createModalWindow(info);

win_error.open();

wdContext.currentContextElement().setWindow(win_error);

win_error.setWindowPosition(WDWindowPos.CENTER);

win_error.setWindowSize(800, 500);

like that use can do.

2> if you want to pass value from the view of one component to view of the other that is also possible. you need to use the interface view controller of the 2nd component and you need to declare the usage of the component in the 1st component.

so from the ist component you need to access the interface voew controller of the 2nd component, you can map the context between them in that way you will be in a position to send data in the other view, view will be in the same window no pop-up will come.

Hope this may help you.

Regards,

Deepak

PradeepBondla
Active Contributor
0 Kudos

Hi,

If you are using DC's and if data transfer is between two different components

then

Lets us take that You have Comp A and Comp B.

Comp A is your parent component and Comp B is your child component.

1. Expose The webdynpro component of Comp B as a public part.

2. In Comp A, Go to Used DCs add the Comp B as a used DC

3. In Comp A, Go to UsedWebdynpro component section and add the Comp B.

4. In the view part of Comp A, create a view from a Interface view, and Create one more view of parent component

5. Go the diagram view of Comp A and create a outbound plug from View of Comp A to Interface view of Comp B

6. Go to the implementation tab

7. On the LeadSelection of tabel record action in the view of Comp A , fire the outbound plug.

Pradeep

namrata_d
Active Participant
0 Kudos

Hi Jean,

What i understand from your situation is when you click on a record in the table a new Pop up window opens which contains the data of the row that was clicked.

As to what you have done is correct you can directly map the context attibutes between the two iviews. And then when the window pops up a method is called which populates the data. The value can be retrieved directly from the context attribute.

In case you are opening an external window through some URL you can also pass parameters bye appending "&param=value1" at the end, where param is the parameter name and Value1 is the value that you want to pass to the external window.

Hope this helps you.

Thanks

Namrata

Edited by: namrata d on Jul 17, 2008 11:08 AM

PradeepBondla
Active Contributor
0 Kudos

Hi,

you want when you click a record in table it should open a pop up? or in the same page?

you can use view sets. it is very simple.

take two views in your application, one will be having a table, and other having a form. just do simple context binding.

in "onLeadSelection" method of table write the code to fetch the data, and in doInit() of other view print the data in your form. put those two views in different view areas of view set and do the mapping in navigation modler.

If you use viewsets, at first you will view only first view (i.e table) when you click the table row, it will show the form view which have data about first view.

is this your requirement? am I clear?

regards,

pradeep