Skip to Content
avatar image
Former Member

How to Fire a Plug in a Different Window

We have a View A in Window A which has 2 buttons:

Button 1: Open View B in Window B

Button 2: Open View C in Wiidow B

So each button opens the same WD Window B but with different views. But there seems to be no way to tell the window which view to show.

lo_window_manager = lo_api_component->get_window_manager( ).
lo_window         = lo_window_manager->create_window( ... ).
lo_window->open( ).

So we decided to try fire the window's outbound interface plugs. Window B's controller was added to View A's properties/usages and then we wrote:

DATA lo_w_addsub       TYPE REF TO ig_w_addsub.
lo_w_addsub = wd_this->get_w_addsub_ctr( ).
lo_w_addsub->fire_to_trial_plg( ).

This dumps on et_w_addsub_ctr( ) with the execption cx_wdr_rt_exception=>no_lazy_ctlr_create.

Controller for View, Window, Interface, and Configuration Cannot Be Created

We've fired window plugs in the past without problem, the only difference here is this is a different window.

Is this the right way to do things? Or is there and easier way?

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Feb 17, 2011 at 01:32 PM

    Alternative Approach:-

    create one inbound plug for each view in win B

    and then two output plugs in window and connect them to views inbound plug.

    create a node with some attribute in comp controller map it to win B and view having the buttons

    on click of diff button set a diff value to this.

    then in the handledefault method check the value of the attribute and fire the corresponding out plug.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      I wanted to do something similar as a workaround but I wasn't sure if HANDLEDEFAULT was fired each time the window was opened. I'm now using one window for each view but it seems clumsy...