cancel
Showing results for 
Search instead for 
Did you mean: 

Used Component as a modal popup to modify data - return text string?

Former Member
0 Kudos

I have just created a small WDA that allows a user to input data into a text field and manipulate it. I have set the Node as an Interface Node.

I want to be able to use this WDA in many different other WDAs through a modal popup and pass a string back and forth.

In my source WDA, I have declared it as a Used Component and created a Window and empty View for it. I have embedded the Used Component View into the empty View. I mapped the Interface Node across the the Context and appropriate Windows/Views.

I am able to launch the Used Component into a modal window and pass my text string to it. I am also able to modify the data. However, what's the best way to get the modified text back to my source window?

In order to launch the modal window, I am using the IF_WD_WINDOW_MANAGER .

thanks a lot,

robert.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

I've made some progress by searching SDN.....

I marked Input Element (Ext.) = 'X' in my child WDA.

Next, in my parent WDA, under Component Usages, I right clicked on my component and Created a Controller Usage.

My child Context node popped up. I clicked the icon above to Create Controller Usage and selected my parent Component Controller. My parent Context appeared on the right.

Now, I mapped the nodes to define the external mapping.

However, when I launch my program, I get a short dump "Recursion when mapping node TEXT_NODE" - where TEXT_NODE is my interface node.

any ideas?

thanks,

robert.

Former Member
0 Kudos

Hi,

Have you done the mapping in two different ways??

What you can do is:

Create the component usage in parent component

Map the interface node of the component usage to the node in the parent component

Launch the window using create_window_for_cmp_usage( )

The passing back of data to the parent component can be implemented by raising an event defined in the interface controller

of the used component using the event parameters. A method defined in any controller of the consumer component may then register for this event.

Hope this information helps you!

Let me know if you have any doubts.

Best Regards,

Srilatha

Former Member
0 Kudos

Srilatha,

yes, i have mapped it 2 ways I think.

the first was mapping the interface node to the parent's node.

the second was when I created a Component Usage in the parent. I right clicked on my Component Usage and chose "Create Controller Usage".

This created an InterfaceController_Usage where I created the 2nd mapping.

I was under the impression that I needed to mark my child interface node's Input Element (Ext.) = 'X' and then create a Controller Usage (in the Component Usages) in the parent and map it.

Former Member
0 Kudos

srilatha,

i see a little more clearly now... I was able to remove the 2nd mapping and call the Used Component's Window using the method create_window_for_cmp_usage. This even passed my string to the used component's window.

Then, I have defined a return_text event in my child's interface controller as you specified, with an event parameter.

I'm a little unclear, though, on how to register the return_text event in the parent WDA.

Former Member
0 Kudos

Hi,

I hope you were able to define an event in your used component and make it as part of interface controller.

Now in your parent component, may be in component contoller, create the usage for interface controller of the used component.

Then define a method as Event Handler and in the event column use F4 to select the event from the interface controller usage.

That means the method is subscribed to the event raised by the used component.

Hope this helps!

Best Regards,

Srilatha

Former Member
0 Kudos

Srilatha.. that did the trick.

at first, I didn't see the dropdown for the Event.. but when I found it over to the right, the interface event was there.

I am now able to pass data back and forth from the modal dialog box...

thanks a million for your help - it was a lot simpler than mapping the Input Element (Ext.) route...

now, I just need to close the dialog box before I raise the Event so that it closes and moves back to the parent screen. but, i should be able to figure that part out.

Answers (0)