on 08-18-2014 6:22 PM
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!
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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-Klasse | CX_BSP_DLC_CONFIG_GENERAL_ERR |
Fehlername | |
Programm | CL_BSP_WD_OVW_VIEWSET=========CP |
Include | CL_BSP_WD_OVW_VIEWSET=========CM003 |
ABAP-Klasse | CL_BSP_WD_OVW_VIEWSET |
Methode | BIND_VIEW |
Zeile | 15 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
6 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.