cancel
Showing results for 
Search instead for 
Did you mean: 

How to open a 2nd WD View in a new window?

Former Member
0 Kudos

Hi,

my WD Component has a button which opens a new view. I would like to open this view in a new window.

I tried to link two views of two windows with plugs, but it seems like I'm only able to navigate between views of the same window....

Up to now my solution was to open the view in a pop up window. Now its neccessary to open the view in a new browser window.

For the background; with click on the button a pdf is generated (Interactive Forms). It is ok to display the generated pdf in adobe acrobat reader directly as well.

Any suggestions how to handle this?

Thanks in advance,

Tan

Accepted Solutions (1)

Accepted Solutions (1)

sahai
Contributor
0 Kudos

hi Tan Yildiz ,

check out this code shared here

method ONACTIONCONFIGURATION .
DATA LO_WINDOW_MANAGER TYPE REF TO IF_WD_WINDOW_MANAGER.
DATA LO_API_COMPONENT  TYPE REF TO IF_WD_COMPONENT.
DATA LO_WINDOW         TYPE REF TO IF_WD_WINDOW.LO_API_COMPONENT  = WD_COMP_CONTROLLER->WD_GET_API( ).
LO_WINDOW_MANAGER = LO_API_COMPONENT->GET_WINDOW_MANAGER( ).
CALL METHOD LO_WINDOW_MANAGER->CREATE_EXTERNAL_WINDOW
  EXPORTING
    URL            = 'http://forums.sdn.sap.com/post!reply.jspa?messageID=9927612'
    MODAL          = ABAP_FALSE
    HAS_MENUBAR    = ABAP_TRUE
    IS_RESIZABLE   = ABAP_TRUE
    HAS_SCROLLBARS = ABAP_TRUE
    HAS_STATUSBAR  = ABAP_TRUE
    HAS_TOOLBAR    = ABAP_TRUE
    HAS_LOCATION   = ABAP_TRUE
  RECEIVING
    WINDOW         = LO_WINDOW.LO_WINDOW->OPEN( ).
    IF SY-SUBRC EQ 0.
      ENDIF.
endmethod.

regards,

sahai.s

Former Member
0 Kudos

Hi,

sahai.s 's solution is working perfectly! Thanks a lot. I just pasted it into my coding and changed the application url. Perfect!

Thanks a lot for your help.

Tan

sahai
Contributor
0 Kudos

hi Tan Yildiz,

you are welcome pleasure is all mine.enjoy

thanks and regards,

sahai.s

Former Member
0 Kudos

One more question, depending the content of my context nodes....

by executing the new WD Window (and the embedded View) in a new browser window the context that was filled in my first WD Window (and View) is not transfered to the new window, right?

My problem is, that my first solution was to open the View in a popup window. All my context content was displayed there, everything was working fine.

Now, by opening the view in a new window, there is no content in the context nodes.

The context node with my input data from another view is mapped to my output view. In my output view there are some calculations executed, using the input data from the first view. This calculated data is stored in the local context node, and should be displayed in my WD view.

How can I solve this issue? How can I transfer context content created in one WD application to another application in the same WD component?

Thanks,

Tan

sahai
Contributor
0 Kudos

hi Tan Yildiz ,

you can make that node(the one which has the data to be transported) in component controller and mark it as an "interface node"

as soon as you make it as an interface node you will find that this particular node will be availiable to use in another wda application.....for this you will have to declare the name of first application in the property tab of the second application. once you did this you will find the interface node availiable in the component controller of the second application...........now you just use get_attribute( ) to get the values from this node.

regards,

sahai.s

Former Member
0 Kudos

Hi sahai,

thank you. I'll try it.

>

> for this you will have to declare the name of first application in the property tab of the second application.

>

Where can I do this? In property tab of second application there is just 'Component', 'Interface-View', 'Plug-Name' and two Help fields editable.

regards,

Tan

sahai
Contributor
0 Kudos

hi Tan Yildiz,

click on he name of the code you are making.

write the program name in "component use" and in "component".press enter description will come automatically.

now you will be able to view the interface node

thanks and regards,

sahai.s

Former Member
0 Kudos

Hi,

is this the way to act when the applications are in differnet WD Components? I thought both WD applications are in the same WD Component and created a second Wd application in the same WD Component....is this wrong? Do I have to create a 2nd WD Component and link the first WD application to the second in the new WD component?

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

>you can make that node(the one which has the data to be transported) in component controller and mark it as an "interface >node" as soon as you make it as an interface node you will find that this particular node will be availiable to use in another >wda application

This is NOT correct advice for your situation. While creating an interface node will allow cross component communication, this only works when you are running in the same user session. As soon as you open your web dynpro component in a new browser window, that is a completely separate user session. In fact depending upon your system configuration, that new user session might even be load ballanced onto a different application server than the original window's user session. The only way to pass data between the two windows is via URL parameters. If you need to pass more data than can be passed on the URL, consider passing a unique key via URL parameter and then writting the data into a temporary database table with that unique key.

Former Member
0 Kudos

What a shame, that it's not working like this.

Thank you for this advice.

Answers (2)

Answers (2)

Former Member
0 Kudos

>

> Hi,

>

> my WD Component has a button which opens a new view. I would like to open this view in a new window.

> I tried to link two views of two windows with plugs, but it seems like I'm only able to navigate between views of the same window....

>

> Up to now my solution was to open the view in a pop up window. Now its neccessary to open the view in a new browser window.

>

> For the background; with click on the button a pdf is generated (Interactive Forms). It is ok to display the generated pdf in adobe acrobat reader directly as well.

>

> Any suggestions how to handle this?

>

> Thanks in advance,

> Tan

if your purpose is to display a interactive form as external window then you have to understand that number of button clicks would result into number of external windows and number of sessions to backend as well. You can't see which external window is related to which data in your application, you cannot close it from your parent window. User has to do that explicitly.

I would consider the following.

Embed the display view into a separate window.

use create_window method to show the window .

gill367
Active Contributor
0 Kudos

Hi

create a new window with the second view.

Then create an application with interface view of second view.

after that in the eventhandler of the button where you are opening the window use the method.

create_external_window like as shown below.

lo_window         = lo_window_manager->create_external_window(
  url = 'http://<host name>: <port>/sap/bc/webdynpro/sap/<application name>'  " here write the url of the second application

).

thanks

sarbjeet

Former Member
0 Kudos

Thank you but unfortuantely it's not working. This are my data declarations:


data lo_window_manager type ref to if_wd_window_manager.
data lo_api_component  type ref to if_wd_component.
data lo_window         type ref to if_wd_window.

lo_api_component  = wd_comp_controller->wd_get_api( ).
lo_window_manager = lo_api_component->get_window_manager( ).

But nothing is happening. As per debugger noticed I deleted the "http://" from the application entry. But with and without the http::// it's not working. There's no error message only in IE's status bar there's the message "javascript.void"....

Any ideas?

gill367
Active Contributor
0 Kudos

check whether popup blocker is enabled or not.

also when you are running the application directly is it working.

thanks

sarbjeet

Former Member
0 Kudos

What does "Java script error" say .

are you sure that the application you call , interface view (window) has the view embedded on it ?. Interactive forms activeX controls are not restricted in your browser etc ?.