cancel
Showing results for 
Search instead for 
Did you mean: 

How to get value from popup window into parent(Main) window in web dynpro

Former Member
0 Kudos

Friends,

I have created one web dynpro application, here In main view i have added one button, and in event of this button I wanted a Popup window with "FormattedTextEdit" component in it, which I created using code :

======

DATA: L_CMP_API TYPE REF TO IF_WD_COMPONENT,

L_WINDOW_MANAGER TYPE REF TO IF_WD_WINDOW_MANAGER,

L_API TYPE REF TO IF_WD_VIEW_CONTROLLER.

L_CMP_API = WD_COMP_CONTROLLER->WD_GET_API( ).

L_WINDOW_MANAGER = L_CMP_API->GET_WINDOW_MANAGER( ).

IF WD_THIS->POPUP IS INITIAL.

WD_THIS->POPUP = L_WINDOW_MANAGER->CREATE_WINDOW(

WINDOW_NAME = 'POPUPWIN'

BUTTON_KIND = IF_WD_WINDOW=>CO_BUTTONS_OKCANCEL

MESSAGE_TYPE = IF_WD_WINDOW=>CO_MSG_TYPE_NONE ).

ENDIF.

L_API = WD_THIS->WD_GET_API( ).

==========

and also created buttons for this popup window using :

====

WD_THIS->POPUP->SUBSCRIBE_TO_BUTTON_EVENT(

BUTTON = IF_WD_WINDOW=>CO_BUTTON_OK

ACTION_NAME = 'POPUP_OK'

ACTION_VIEW = L_API

IS_DEFAULT_BUTTON = ABAP_TRUE ).

WD_THIS->POPUP->SUBSCRIBE_TO_BUTTON_EVENT(

BUTTON = IF_WD_WINDOW=>CO_BUTTON_CANCEL

ACTION_NAME = 'POPUP_CANCEL'

ACTION_VIEW = L_API

IS_DEFAULT_BUTTON = ABAP_FALSE ).

WD_THIS->POPUP->OPEN( ).

====

Which is working very fine, but now I want the value of the component - FormattedEditText of my popup window in to my parent(main) window on the event pressing Ok Button( POPUP_OK) . Can anyone please tell me how can I get this Texts in my parent Window.

Regards,

Hiren.

Accepted Solutions (1)

Accepted Solutions (1)

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

Within the view that has the FormattedTextEdit that is inside your popup window - just map the context of this view from the component controller. Then the parent view of the popup can map to the same component controller context. The component controller is global over all views - including those within a popup.

Former Member
0 Kudos

Thanks Mr. Thomas, your answer was very useful for me, Also can you please suggest any good reference material / Book for Web dynpro ABAP as I am just a biginner in Web Dynpro and wish to get professional level knowledge. Thanks again.

Former Member
0 Kudos

HI Hiren,

If you search in SDN , you will find some good and n number of document and examples available in SDN.

SDN wiki page lnik - http://wiki.sdn.sap.com/wiki/display/WDABAP/WebDynproABAP+Home

Regards,

Varun

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

would you please help me,

*****************************************************************

DATA: L_CMP_API TYPE REF TO IF_WD_COMPONENT,

L_WINDOW_MANAGER TYPE REF TO IF_WD_WINDOW_MANAGER,

L_API TYPE REF TO IF_WD_VIEW_CONTROLLER.

L_CMP_API = WD_COMP_CONTROLLER->WD_GET_API( ).

L_WINDOW_MANAGER = L_CMP_API->GET_WINDOW_MANAGER( ).

IF lr_POPUP IS INITIAL.

lr_POPUP = L_WINDOW_MANAGER->CREATE_WINDOW(

WINDOW_NAME = 'W_POP_UP'

BUTTON_KIND = IF_WD_WINDOW=>CO_BUTTONS_OKCANCEL

MESSAGE_TYPE = IF_WD_WINDOW=>CO_MSG_TYPE_NONE ).

ENDIF.

L_API = WD_THIS->WD_GET_API( ).

=======> this tep, creating Buttons is not workimg with me, how have you done it

with me is always getting error ,

lr_POPUP->SUBSCRIBE_TO_BUTTON_EVENT(

BUTTON = IF_WD_WINDOW=>CO_BUTTON_OK

ACTION_NAME = 'POPUP_OK'

ACTION_VIEW = L_API

IS_DEFAULT_BUTTON = ABAP_TRUE ).

and after klicking ok.. how did you generat it? with saving, is ther a special event handler for this?

lr_POPUP->SUBSCRIBE_TO_BUTTON_EVENT(

BUTTON = IF_WD_WINDOW=>CO_BUTTON_CANCEL

ACTION_NAME = 'POPUP_CANCEL'

ACTION_VIEW = L_API

IS_DEFAULT_BUTTON = ABAP_FALSE ).

lr_POPUP->OPEN( )