cancel
Showing results for 
Search instead for 
Did you mean: 

Pass data between component

Former Member
0 Kudos

All,

I want to pass the data from one component to another component. Could anyone tell me what all are the step i have to carry out..

Thanks..

BM

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Server-side eventing is used to exchange data across component borders. External context mapping is used as a means of mapping the context elements of an embedded Web Dynpro component to the context elements of the outer Web Dynpro component.

Please go through the tutorial to know how

<a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/e8d7cd90-0201-0010-4a8c-dd22fa16ca0a">Server side eventing</a>

Answers (6)

Answers (6)

Former Member
0 Kudos

Sorry for the delayed reply..

I'm trying to pass the data via External mapping..i have 2 component called Parent & Child. each one has one view. When i click button in parent view, it should call child view from different component..

I did all mapping & built, and deployed..But when i click the button getting below error:


java.lang.NullPointerException 

    at com.yal.nav.ParentView.onActionSubmitto(ParentView.java:155)
    at com.yal.nav.wdp.InternalParentView.wdInvokeEventHandler(InternalParentView.java:143)
    at com.sap.tc.webdynpro.progmodel.generation.DelegatingView.invokeEventHandler(DelegatingView.java:87)
    at com.sap.tc.webdynpro.progmodel.controller.Action.fire(Action.java:67)
    at com.sap.tc.webdynpro.clientserver.task.WebDynproMainTask.handleAction(WebDynproMainTask.java:101)
    ... 23 more

can one one tell me wha i'm missing..
BM

Former Member
0 Kudos

All,

int i = 5;

wdThis.wdGetParentController().wdGetContext().currentDataSourceElement().setCounter(i);

If i comment the above line then there is no issue, but If uncomment its giving the above error which i posted in my previous thread...

Can anyone tell me how to avoid the error & passing the data into component controller..

BM

Former Member
0 Kudos

I solved this issue using External Mapping..The tutorial is not so clear enough..it took me long to understand..

Thanks for all your help & Support..

BM....

asif_hirani
Active Participant
0 Kudos

Hi Bharathi

u want on buton click , view1 of comp1 should transfer data to view2 of comp2

1) create first componet comp1/parent

go to its component controller

create VALUE NODE : Person

create VALUE ATTRIBUTE : firstname ( for person node )

create VALUE ATTRIBUTE : lastname ( for person node )

set cardinality : 1..n

open data modeller ( double click comp1)

mapp this node to View1 of comp1

so that same person node is replicated in view's context

in layout of view apply template to display this person

node with firstname and last name as input field

insert button with some label in view1

2)create Second component comp2/child

go to its interface controller

create same VALUE NODE : Person

create VALUE ATTRIBUTE : firstname ( for person node )

create VALUE ATTRIBUTE : lastname ( for person node )

set cardinality : 1..n

also set IsInputElement Property : true (property for node on interface controller only )

open data modeller ( double click comp1)

go to component controller

map the interface controller data to component controller

remember interface controller will recevie data from comp1(parent)

and component controller will pick data from interface controller

so direction of mapping should be starting from component controller and stretching

on to interface controller .Since there's nothing in the context of component controller

so u can drag n drop entire value node person from interface controller onto component controller

mapp this node to View2 of comp2

so that same person node is replicated in view's context

in layout of view apply template to display this person

node with firstname and last name as input field/text field

3)go back to parent/comp1

go to its used web dynpro component

add/ embed child/comp2 as used web dynpro component

give some other name Comp2_usage or child_usage for example

open data modeller of comp1/parent ( double click comp1)

u will see chil / comp2 embeded in its used web dynpro component

just mapp interface controller of comp2/child to component controller of comp1/parent

remember mapping will start from interface contorller of embeded comp2/child and stretch upto

component controller of comp1/parent

finally emded interafce view of child/comp2 that is comp2usage.comp2InterfaceView inside window

of comp1/parent component this interface view will have default input plug attached to it and then u can create outbound plug on view1 and create Navigation link from view1 outboud plug to

interfaceview of embeded child/comp2 view that is interface view for ur view2

4)create Application for ur parent /comp1 and deploy and test ur application which should now send the data input to view1 of comp1 to view2 of comp2

hope u got ur project working now

regards

Asif

Former Member
0 Kudos

Thanks for all your reply..Will try & get back to you..

BM

Former Member
0 Kudos

Im totally lost...pls guide with steps..

Actually, view1 from Comp1 is calling View1 of Comp2. When I click the GO button from View1 of Comp1, data should be accessed by view2 of Comp2.

Can anyone help with steps & code to access the data..

Thanks..

BM

Former Member
0 Kudos

Bharathi,

I suggest you to go through this link for understanding the concept

https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/e8d7cd90-0201-0010-4a8c-dd22fa16...

Regards,Anilkumar

Former Member
0 Kudos

Thanks for your input. But i could not able to understand since its explaining many things like creation of dynamic components etc. I would appreciate if you help kme with the steps..

BM

Former Member
0 Kudos

Bharathi,

Check this link then http://help.sap.com/saphelp_nw2004s/helpdata/en/66/a5384162316532e10000000a1550b0/frameset.htm

Still if you are not clear then i will try to describe all the steps

Regards,Anilkumar

former_member186016
Active Contributor
0 Kudos

Hi,

This tutorials will help you:

<a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/a137c339-0b01-0010-a688-a87b88706845">How to Navigate Inside Web Dynpro Component Interface Views</a>

Also the tutorial which Anil pointed in his last to last post, exactly matches what you want to do.

You can download the example component from SDN. The link is given in the link given by me in my first post in this thread.

Regards,

Ashwani Kr Sharma

Former Member
0 Kudos

Hai,

See

Regards,

Naga

Former Member
0 Kudos

Hi Bharati,

Go through the following thread. I hope this will help you solve your problem.

https://forums.sdn.sap.com///click.jspa?searchID=2840041&messageID=503651

former_member751941
Active Contributor
0 Kudos

Hi Bharti,

In this case you have to use GP work flow.

In Webdynpro

-


In your webdynpro project you implement the “IGPWebDynproCO” interface. It will provide to two default methods “getDescription” and “execute” you have to implement this two methods.

When you will create a GP Callable object using “Web Dynpro Component (GP Interface)” user interface ”getDescription” will be invoke it tells about input/output parameters

Structure.” execute” will be invoke when you will execute the callable object to test it.

Check this link to implement the GP Interface (IGPWebDynproCO)

https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/50d74ada-0c01-0010-07a8-8c118d40...

GP

-


Step 1 : creates two callable objects.

-


1> Create Callable object (CO1) for comp1 [using Web Dynpro Component (GP Interface)].

2> Create Callable object (CO2) for comp2 [using Web Dynpro Component (GP Interface)].

Step 2 : creates two Actions.

-


1> Create Action (AC1) and insert “CO1” under it.

2> Create Action (AC2) and insert “CO1” under it.

Steps 3 : create a block.

-


1> Create Block (BLOCK1) and insert “AC1” and “AC2” under it.

Here you have to do the parameter mapping.

Step4 : Create a process:

-


1> Create a Process (PROCESS1) and insert “BLOCK1”.

Activate the process and instantiate it.

Check this link

-


http://help.sap.com/saphelp_nw2004s/helpdata/en/83/588041a17e060de10000000a1550b0/frameset.htm

Regards,

Mithu

venkatakalyan_karanam
Active Contributor
0 Kudos

Hi

To pass the data/fetch the data between the components can be done using context mapping between the components.First you declare the use of the component (to which you have to pass the data) in your developed component.

Then open the data modeler Tool by clicking the context menu of the component.

Create a data link between your component and the component which you want to pass the data.In the wizard appears perform the mapping of the nodes to share the data.

regards

kalyan

former_member186016
Active Contributor
0 Kudos

You can use context mapping to achieve this.

Go via following link :

http://help.sap.com/saphelp_nw2004s/helpdata/en/22/15a441cd47a209e10000000a155106/frameset.htm

Following example will also be useful for you:

/docs/DOC-8661#4 [original link is broken]

Regards,

Ashwani Kr Sharma