cancel
Showing results for 
Search instead for 
Did you mean: 

Problems in transferring data from pop-up

Former Member
0 Kudos

Hi Experts,

I have 2 components A and B.

I am raising a view of component B in component A as a pop-up.The code for raising the pop-up is written in WDDOINIT of component controller of comp A.

Based on the data entered in the pop-up, I need to set certain checkboxes in the view of compoent A.

Problem I am facing is the view of Componet A is rendered before the pop-up actually comes up, as a result, I am not able to make the changes(like checking a checkbox)in the view based on the input in the pop-up.

Based on the input given in pop-up, I am setting the context nodes, but the view of component A does not get effected by this since it is already rendered.

I understand that, pop-up will not be called as soon as I write the code to call the pop-up.

Is there any way out of this?

Have any of you faced such issues?

Is there any way to 'Refresh' the screen so that the latest context node values are considered?

Plesse share your thoughts on this.

Regards,

Aditya.

Accepted Solutions (1)

Accepted Solutions (1)

RicardoRomero_1
Active Contributor
0 Kudos

This is due to the phase model:

http://help.sap.com/saphelp_nw04s/helpdata/en/d2/8acd409cc4dd50e10000000a1550b0/content.htm

May be you can create an event as interface in comp B, and create a method as event handler for this event in comp A. Within this method do the modifications in the context.

Then when you close your popup fire this event...

Try and tell us.

Former Member
0 Kudos

Hi Ricardo,

Thanks for your time.

I have a slightly different scenario now.

What I did is, I created a new window in component A and embedded the interface window from component B.

Next I tried to call this new window as a pop-up from WDDOINIT of my view in component A(with 'OK' button in pop-up).

Also created an action handler for the 'OK' button in the same view controller.

Successful till here.

I tried this so that, on click of 'OK' button, a round trip would be triggered and entire phase model would get executed.

Everything works fine till here.

In the event handler , i set certain context nodes based on the input in my pop-up and on close of pop-up, I expect the component A's view to get effected by this.

But unfortunatly, this does not happen and view has the old data itself.

So even though there was a round trip, things did not work.

Is this a problem with context nodes?

I even tried to invalidate the nodes and still no effect..all old data still present in the view.

Any idea why this would happen?

Regards

Aditya.

Edited by: Aditya Karanth on Nov 16, 2011 4:48 PM

Former Member
0 Kudos

Everything works fine till here.

In the event handler , i set certain context nodes based on the input in my pop-up and on close of pop-up, I expect the component A's view to get effected by this.

But unfortunatly, this does not happen and view has the old data itself.

This is kind of bothering, normal cases it should work. I am not sure about the sources of your node. if these nodes are from component A and they have context binding with view-A then i would certainly expect that the values are changed in view-A.

if the nodes are from some used components common to the component A and Component B then you may have a problem of 2 instances at runtime exists. Do a debugging and see if instance id's are same.

I also not sure about your design to bring a popup on DoInit of the view, doinit is called only once.

Edited by: Baskaran Senthivel on Nov 16, 2011 2:56 PM

RicardoRomero_1
Active Contributor
0 Kudos

Hi Aditya,

I don't know if i understood good your scenario, but i've tried to recreate it in my system and is working fine. I did the following:

I've created a component B, in this component I have a interface node with the data I want to retrieve to my component A.

This component B has also an interface event. In my view I have also a button 'OK' that triggers the interface event.

I've created a component A, in this component I've added as used component my component B. I've done the binding between my interface node in component B and the context in my view in component A.

I've created an attribute in my default view in component A called "zz_window" type ref to IF_WD_WINDOW.

In the method WDDOINIT I call the window in component B as popup using the method create_window_for_cmp_usage. And i assing the window to my attribute "zz_window". I don't subscribe to any event.

For close this popup and read the context I've created a method as event handler for the interface event created in component B. Within this method I read the interface node in component B and do the binding with the nodes i want in my comonent A. Then I close the window using wd_this->zz_window->close( ).

The data is displayed properly in my view in component A.

I don't know if it's the same scenario, hope this help you...

Regards.

Former Member
0 Kudos

HI Baskaran,

Yes the context node does not belong to component A.

But actually the issue is with a flex component and not a normal WD view element.

I am opening a new thread on this.

I bound the context to a normal WD screen element and got the updated context values, but the Flex component is not updating.

Thanks for your inputs,

Aditya.

Answers (0)