cancel
Showing results for 
Search instead for 
Did you mean: 

how to generate pop up window in webdyn pro abap?

Former Member
0 Kudos

Hi,

I am new to webdyn pro abap.i have one component with button and textfield.on click of button pop up window should appear containing an input field and on click of button in the pop up window,the text entered should get displayed in the component's textfield.kindly guide.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Try using the below code for creating a pop up.

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.
  DATA l_api             TYPE REF TO if_wd_view_controller.

  lo_api_component  = wd_comp_controller->wd_get_api( ).
  lo_window_manager = lo_api_component->get_window_manager( ).
  lo_window         = lo_window_manager->create_window(
              window_name            = 'Window Name'
              title                  = 'Title for the pop up'
              message_display_mode   = if_wd_window=>co_msg_display_mode_none
              message_type           = if_wd_window=>co_msg_type_none
              default_button         = if_wd_window=>co_button_cancel
               ).

  wd_comp_controller->go_window = lo_window.

  lo_window->open( ).

In the code for ok button, set the value to the attribute that you require.

Answers (3)

Answers (3)

Former Member
0 Kudos

Thanks all.

Former Member
0 Kudos

Hello,

Refer to following article which explains the usage of popup windows in web dynpro with examples:

http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/90b46fb9-e48f-2c10-eaa8-cb47d9c91dce

Hope this helps!

Regards,

Srilatha

Former Member
0 Kudos

Hi

Simple way is to define in your component controller a context node (data) there in a context attribute called text.

create 2 views . (Main View and popup view)

Both view has context mapping with data node from component controller.

In main view use text view element and bind attribute text with context attribute text.

in popup view use input field and bind attribute text with context attribute text.

create two windows and embed main view in main window, popup view in popup window.

now on action button clicked - you can call webdynpro code wizard (ctrl + F7) and click second tab(General)

you can click the generate popup radio button ,fill in popup window for the window name and press Ok.

Code will be generated.

since you are sharing one context attribute you don't have to work with any event handlers from your popup view.

in complex scenario's, you can create events in your popup view and subscribe to that events in your main view to close pop up or data population.