cancel
Showing results for 
Search instead for 
Did you mean: 

Fire Plugs Between Windows

Former Member
0 Kudos

We have a list in a view in a WDA window (A) which is bound to an internal table. When the user clicks a button, a popup WDA window is opened (B) which allows them to add something to the list. When window B is closed, how can we inform the view in window A to refresh? Refreshing on every WDOMODIFYVIEW seems a waste. Is there any way for windows to communicate an event perhaps with inter-window plugs?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

if_wd_window provides SUBSCRIBE_TO_BUTTON_EVENT.

You can use this method to subscribe to the event of the popup window.

Former Member
0 Kudos

I don't understand how the f_wd_window=>co_button_yes can work -> my popup has no "YES" button.

Could you provide a code example which shows a) the window B being opened and b) the code in the window B which fires the event?

Former Member
0 Kudos

Hi,

How do you generate popup window ? What buttons does it have ?

If it is your custom view then you have to define a event in component controller. Fire this event from popup view and Subscribe this event in your main view.

Former Member
0 Kudos
lo_window         = lo_window_manager->create_window(
                  window_name            = 'W_ADDSUB'
                  title                  = lv_text
                  close_in_any_case      = abap_true
                  message_display_mode   = if_wd_window=>co_msg_display_mode_selected
                  close_button           = abap_true
                  message_type           = if_wd_window=>co_msg_type_none
                  ).
Former Member
0 Kudos

Ok,

as i already said, you can create a event in component controller.

Fire this event from popup view.

Subscribe this event in view

Former Member
0 Kudos

That sounds like a workaround which is not much better than what I currently do: firing an outbound plug on Window A from the view in Window B.

DATA lo_window       TYPE REF TO ig_w_main.
o_window = wd_this->get_w_main_ctr( ).
lo_window->fire_subscription_added_plg( ).

Former Member
0 Kudos

Hi Marc,

Can you please explain me how do you get it worked navigating from popup window to a parent window via outbound plug ?

Probably you already have better solution.

I have posted what i would do and recommend.

Former Member
0 Kudos

First, add the window A (e.g. W_MAIN) as a usage to your view B (under properties).

When the user clicks "Add" in your popup window B you fire the outbound plug of your window A:

DATA: lo_window TYPE REF TO ig_w_main.
lo_window = wd_this->get_w_main_ctr( ).
lo_window->fire_yourplug_plg( ).

Now all you do is wire your outbound window A plug to the view you want to refresh. In that view the HANDLEIN does all the refreshing from any plug input so the refresh code is in one place.

Answers (0)