cancel
Showing results for 
Search instead for 
Did you mean: 

Multiple Components & Data Sharing

Former Member
0 Kudos

Hello All,

We are in the process of laying out the design of all the webdynpro components that will be used in this project. Our scenario is there will be a Main Component that will be having the roadmap UI element and Header Information that will be common across all the road map steps. Each roadmap step will be a separate webdynpro component all together. We will be using interface views of these sub components in the Main in each step.

We are breaking down all the step to different components because there will be 3 developers working on individual components and then finally we will integrate it to the Main component.

My query is how can we achieve data sharing between all these components. The same nodes data can be edited in 3 - 4 different components. Does External context mapping work in this scenario? Can we map a node that is there in the main component to other components and edit them separately in different components. In this case will the main component have the latest data edited in different component?

Is there any other better way to achieve data sharing since this is a multiple webdynpro component design? Please not that our production servers have different multiple instances for load balancing. This should not cause any issue in the data being stores as well.

Need your thoughts.

Thanks,

Nagarajan.

Accepted Solutions (1)

Accepted Solutions (1)

amy_king
Active Contributor
0 Kudos

Hi Nagarajan,

You can use a Faceless Component, a.k.a., a Model Component, to supply the data required by the multiple other components. Faceless components are used when several components need access to the same application data. Changes made to the faceless component's context nodes by one component will be reflected in all other components that use the faceless component, including changes such as lead selection.

Cheers,

Amy

Former Member
0 Kudos

Thanks for the reply Amy. I am trying to create Test WD Components but not able to pass the data between different components. Here is the scenario I am trying out -

Component Design


1) ZFACELESS COMPONET

2) ZMAIN COMPONENT - Has a Tabstrip UI element and the main component UI has has few input fields.

3) ZSUB COMPONENT - Has few Input fields

Used Component Definitions and Mapping

1) In the Faceless component I have an Interface Node definition with Req ID, Name, App ID and Name as 4 attributes.

2) ZMAIN uses both faceless and sub component. Faceless component for getting the data and Sub component Interface View will be used in the Main View's tabstrip UI as another tab.

3) ZSUB uses Faceless component for the data.

What is Happening?

1) I have hard coded Req ID in the Faceless component which is appearing good in both the tabs of the Main and Sub components.

2) I am giving Req Name in Main Component View and App details in the Sub Component View

3) There is a common button in the Main component for all the tabs in which I am reading the attribute details. I get only the Req Details. The App details given in the same node in a different component is not mapped.

I instantiated the faceless and sub components in CC Init of Main component.

Am I missing something here? Should I need to pass the faceless component instance to the sub component in the Init?

Thanks,

Nagarajan.

amy_king
Active Contributor
0 Kudos

Hi Nagarajan,

I found a demo web dynpro component that may be helpful to you as a reference.

Component DEMO_SIMPLE_MAIN uses a faceless component, DEMO_SIMPLE_MODEL, for its data and another component, DEMO_SIMPLE_UI, for its view. DEMO_SIMPLE_UI also declares a component usage of DEMO_SIMPLE_MODEL, so the scenario sounds very similar to yours.

In DEMO_SIMPLE_MAIN, the two component usages are instantiated in the component controller's WDDOINIT method and then there's an additional step to pass a reference of the model to the UI component-- so you may be correct that this step is what you're missing.

Cheers,

Amy

Former Member
0 Kudos

Bingo !!!

Answers (4)

Answers (4)

marcin_cholewczuk
Active Contributor
0 Kudos

Hi,

I would use class along with singleton concept (all components are using the same class for which only one instance can be created) and set it as assistance class in each wd controller.

Best Regards

Marcin Cholewczuk

Former Member
0 Kudos

Thanks Madhu and Abdhulla for your valuable inputs. Sorry, we are not at a position to implement FPM currently.

Former Member
0 Kudos

Hi Nagarajan,

For data sharing in Floor plan manager you can go through this link.

http://scn.sap.com/docs/DOC-32067

Regards

Madhukiran M.

Former Member
0 Kudos

You can also look into implementing a Floor Plan Manager application that uses a shared data component.