cancel
Showing results for 
Search instead for 
Did you mean: 

Passing context nodes across multiple WD components

Former Member
0 Kudos

Hello,

I am trying to develop a wizard-type application where the user has to enter data across multiple steps to finally create a purchase requisition in R/3. Each step is encapsuled in a single WD component, there a 6 steps / components that we'll just call A, B, C, D, E and F. Additionally, there is a "master" component that controls the program flow between the steps.

The data being collected by all the steps is supposed to be saved in a tree structure in the context (there's a 1:1 node "purchaseRequisition" with a few value attributes and a 1:n subnode "lineItem" with another set of attributes and a 1:n non-singleton subnode "services" with another set of attributes.

Each screen is supposed to collect some of the data of this tree. The last step / or the master component / is supposed to use the collected data to call the adaptive RFC model and execute the BAPI.

What I've done so far:

all the single-step components are stated in the Used Components part of the master component.

The master component runs in a window, together with the currently active single-step component. Navigation between the single-step components works fine. I've set up the last single-step component (F) to "host" the context node purchaseRequisitions. Its interface view is linked to this contextnode. All the other single-step components are using this WD component F and link their contextnode to the interface context of F. At the end of the wizard, at step 6, component F hasn't "received" any of the previously input data, though. I reckon this is because each single-step component is using its own "version" of the interface controller F and hence aren't really passing the data down to component F.

I cannot use the master component to store the "original" context node, because this would mean a circular usage, where the master uses component A and component A again uses the master.

So what I need to know is:

If I've got a master component that uses multiple WD components, one after the other, how can all these components share the data of one specific context node?

Thanks for your help,

Fabian

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Will,

Sometimes cyclic references are inevitable with WD, the most common case is when you need both context mapping and calling methods/receiving events. So just don't worry about NW IDE warnings (sure, if they are not errors ;).

You need something like this:

1. Create all usages in master component (A through F)

2. Create mapped node "purchaseRequisitions" in master component and map it to node from F

3. In components A..E mark necessary context node (in interface controller) as isInputElement=true. This will allow reverse context mapping in next step.

4. Map context node from every component usage A..E to context node of component usage F.

This way you will have "single source of truth" -- component usage of F, all the rest (master and usages A..E) will have mapped nodes.

Also, do not create separate usages of F in components A..E (it's not clear from your description whether or not you do). If you need to access methods of F, then declare interface controller method init(F f) on every component from A..E and pass interface controller usage of F from master.

Valery Silaev

SaM Solutions

http://www.sam-solutions.net

Former Member
0 Kudos

Valery,

thanks for your feedback. Your suggestions exactly filled the gaps that I had (and hence answered my question). I was not aware of the isInputElement functionality nor did I grasp the concept of linking nodes of interface controllers to each other.

Also many thanks for the tip regarding the passing of the interface controller to use methods of component F instead of adding F as a used component to all the other components. I don't need this here, but it might come in handy in the future and it demonstrates well the general approach of sharing components.

thanks again,

regards,

Fabian

Answers (2)

Answers (2)

Former Member
0 Kudos

Try to add one more component - like 'Common' and add it as used component to all your existing components with type 'create manualy' . U can instantiate it manually in master component and pass it as parameter to all other components. But here u need to make node mapping dynamicaly to be able to share common data.

Former Member
0 Kudos

Denis,

thanks for your input. Although this might work, it sounds more like a work around to the solution described by Valery. So I'll try his suggestions first. But nevertheless, thanks for this reply!

Points awarded.

Former Member
0 Kudos

Hi,

Did you check the Componentization topic ??

Please go through [original link is broken]

Regards, ANilkumar

Former Member
0 Kudos

Anilkumar,

thanks for your input - I have read most of the articles about componentisation and either my specific requirements weren't in there or I've skipped those parts. I am just trying out Valery's suggestions as they seem to be right on the spot.

Again, thanks for your help, points are rewarded.