cancel
Showing results for 
Search instead for 
Did you mean: 

Call Inbound Plug or other method of usage component

Former Member
0 Kudos

Hi guys,

in crm web ui  i created one component named "A" which has several component usages. One of the usage component is named "B".

Now the usage component "B" has an inbound plug called "ClearAll", which i want to trigger from component A.

How do i do that? Or more specific, how do i get the interface controller of component B, so that i can call a the inbound plug method "clearall",

My Problem is not about Popups.

in WD_USAGE_INITIALIZE i'm already able to populate the context, but what i need is a method call before or after sharing the context node:

call method super->wd_usage_initialize
     exporting
       iv_usage = iv_usage.

   case iv_usage->usage_name.
     when 'CUBP_HEAD_SEARCH'.
       try.

         iv_usage->bind_context_node( iv_controller_type  = cl_bsp_wd_controller=>co_type_component
                                      iv_target_node_name = 'PARTNER2'
                                      iv_node_2_bind      = 'PARTNER' ).


Thanks!

Accepted Solutions (1)

Accepted Solutions (1)

ceedee666
Active Contributor
0 Kudos

Hi Sven,

have you tried the following:

me->get_controller( '<the name of the controller you want to get>' ).

or

me->get_custom_controller( '<the name of the custom controller you want to get>' ).


Christian

Former Member
0 Kudos

Unfortunately the Controllerlist m_subcontrollers contains only the main controller of Component A:


method GET_CONTROLLER .
   data: subc  type LBSP_CONTROLLER_ITEM.

   subc-component_id = controller_id.
   translate subc-component_id to lower case. "#EC TRANSLANG
* check if this component-id is already used and return the controller_instance
   read table m_subcontrollers into subc with key component_id = subc-component_id.
   if sy-subrc = 0.
     controller_instance ?= subc-instance.
     return.
   endif.

endmethod.


What i have at the moment is following:


data lr_interface_view type ref to CL_BSP_WD_REP_VIEW.

lr_interface_view = iv_usage->get_interface_view_def( iv_name = 'SearchHelpWindow' ).


but i need to get the window controller

ceedee666
Active Contributor
0 Kudos

Hi Sven,

do you know this document:

While it is about the navigation it has some code examples that might be helpful for you.

Accessing a window controller is possible via me->view_manager->get_window_controller( )


Christian

Answers (3)

Answers (3)

Former Member
0 Kudos

Very Good ! thanks for this, i also analysed a little bit yesterday and achieved to really call the window controller:

What i wanted to do is to call the clear_all of BP_HEAD_SEARCH - component, which i always specified as component B.

In Component A using BP_HEAD_SEARCH, i hooked some coding into method DO_PREPARE_OUTPUT of the only View, which is an overview Page

Hooking up this method, i'm sure that the initialitation of all context nodes etc. of component B took place and i'll be able to successfully call the inbound plug:

if me->prepared_output <> 'X'.

  data lr_usage type ref to cl_bsp_wd_component_usage.

  data lr_if_window type ref to cl_bp_head__searchhelpwin_impl.

  data lr_if_window_abstr type ref to  cl_bsp_wd_window.

  lr_usage      ?= me->comp_controller->get_component_usage( 'CUBP_HEAD_SEARCH' ).

  lr_if_window ?= lr_usage->get_interface_view_contr( 'SearchHelpWindow' ).

  lr_if_window->ip_clear_all(  ).

  ....

endif

the clue was not to use the interface if_bsp_wd_component_usage, but to use the class cl_bsp_wd_component_usage as type of the usage object.

Doing so, i'll be able to call method get_interface_view_contr which will give me the window controller finally.

But your solution is good as well !

Thanks!

Former Member
0 Kudos

ok my happiness was to early... navigation seems not to work in my scenario, as my component A has only one overviewpage. And when i navigate from my window controller of component A to the inbound plug of component B's interface:

" Navigation funktioniert nicht von einer Übersichtsseite aus

  me->view_manager->navigate( source_rep_view = me->rep_view
                                                        outbound_plug = 'CLEAR_ALL').

i get the exception of

This brings me again back to the question, how to access the methods of the window controller of component B.

   

Exception-KlasseCX_BSP_DLC_CONFIG_GENERAL_ERR
Fehlername
ProgrammCL_BSP_WD_OVW_VIEWSET=========CP
IncludeCL_BSP_WD_OVW_VIEWSET=========CM003
ABAP-KlasseCL_BSP_WD_OVW_VIEWSET
MethodeBIND_VIEW
Zeile15
ceedee666
Active Contributor
0 Kudos

Hi Sven,

you should always be able to get a custom controller of a used component via the get_custom_controller method. If you, for example, take component BP_HEAD. One of its usages is BP_ADDR:

The name of the custom controller of this component is BP_ADDR/CuCoAddress:


So in any controller in BP_HEAD you should be able to do the following:


me->get_custom_controller( 'BP_ADDR/CuCoAddress' ).


If you now move the logic for clear_all (I supposes this does some clean up of some context data) to a custom controller (e,g. 'Z_MY_COMP/MyCuCo') you could do the following:

data(my_cuco) = me->get_custom_controller( 'Z_MY_COMP/MyCuCo' ).

my_cuco->clear_all( ).


Hope this helps,

Christian

Former Member
0 Kudos

thank you 😉 !

That's it and the Solution here is so simple:

1) Create outboundplug for Component A

2) Create NavigationalLink between Comp A and Inboundplug Comp B

3) Via outboundplug of comp A i can fire inbound plug of comp B

ceedee666
Active Contributor
0 Kudos

It's always like that. Once you know the answer it seems trivial.

Anyway, the document by is always very helpful when it comes to navigation in the Web UI.

Best,

Christian