on 10-16-2007 5:00 AM
Hello,
How do you pass a value from one component to the other, and back, via context? I created a two components on my dynpro project, each component has only one view. I wanted to try to pass the data between them. When I tried to map the data on my interface (Component B), and then try to run my application, it displays nothing. Anybody has any idea how should I do this?
regards,
arnold
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
You have two components CompA,CompB
1) Create "Used Webdynpro Component" in CompA
1.a) Add "Used Component"
1.b)Specify name
1.c)Browse the Used Web Dynpro Component..SELECT CompB from the list
-
2) Now "Open Navigation Modeler" of CompA's Window
2.a) Use "Embed Interface View of component instance"
2.b) Select CompBInterfaceview .. FINISH
-
3) Now you can link bothe the CompA and CompB views using Inbound and OutBound Plugs
3.a)OnClick action of CompA's default view button "wdThis.wdFirePlug<>;"
-
4)Pass the value of the input field's value as the parameter to the CompB's view
-
now you will be to access the CompB's elements in CompA ,vice versa
Regards
Abhijith YS
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi All,
I got it to work. Thanks. I got confused first, because there was where you create the component to be used. On my 2nd component, I created the same on inside, but it shouldn't be that way. I just created a context to its Component Interface.
I also got the passing of events to work.
Thanks again.
regards,
arnold
U can use context mapping,
Create a context in controller, view1, view2.
Map view1 to controller and similarly do for view2.
set the value in the context attribute of view1 u can get
in view2 also.
It is possible to use the context value between two views without using a component controller.Through the fire plug methods u can easily pass the values between two views.
while creating outbound and inbound plugs create the parameters also for them.
in the 1 view implementation on button action:
onAction()
{
String name = wdContext.currentContextElement().get<att>();
wdthis.wdfireplugto2view(name);
}
In the second view implementation:
onplugfrom1view(){
wdContext.currentContextElement().setRes(name);
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Kanwalpreet,
Thanks for the reply.
Is it possible not to use plugs? I am only trying to pass a value to a popup window.
Here is what I did. I have Comp A and Comp B, both has a view in it. Comp B's view is displayed as a dialog.
When I click a button on A, it stores a value on its context. In turn, the context is mapped to my controller context. the controller context is then mapped an interface controller (B's interface controller).
When I tried it this way, it doesn't display anything. When I removed the mapping between Comp A's controller and the interface controller, it displays the fields.
Am I doing this wrong?
regards,
arnold
Hi! Arnold,
i tried to pass one textview value from one comp to other within one WebDynpro appl. and i am getting the desired output.
Here is the Steps:--
i am having two comp say CompA, CompB and their corresponding views i.e viewA and viewB.
1.make a value attribute in Interface controller of CompA.
2.map this attribute to context of viewA.
3.in CompB add this CompA as Used WebDynpro Component.
4.in DataModeler of CompB, map the context of InterfaceViewA to ViewB Context.
5.Now i find the data of ViewA(CompA) and ViewB(CompB) is synchronized.
regards,
Mithileshwar
Hello Mithileshwar,
Thanks for the reply. I did what you mentioned, but I am encountering this problem:
Looking at the diagram view, here is what I did following your instructions:
viewA -
> Component Controller -
> Interface Controller of CompB
its context is mapped, from viewA, to the Component Controller, then to the Interface Controller of CompB.
This context is mapped to an InputField on viewA. When I tried to run the application, the InputField tends to be disabled, or behaves like my cardinality is set to 0..1, but my cardinality is 1..1.
do you happen to know why?
regards,
arnold
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.