on 06-21-2008 8:17 AM
I have defined a viewContainerUIelement in my MAINVIEW and several VIEWs in my component. Each time, I start the WD application, I need the viewContainer choose one of the VIEWs to show according to some conditions. How can i realize it in my code?
Hi,
After Embedding all the required views in the View UI Container , link them through the plugs and fire the relevent plugs of the View which want to display.
Eg, if Embed View A, View B, View C in the Main View,Link these Inbound plugs from the View A, View B ,View C to Main Outbound Plugs .After that call the Relevent outbound plug in the WDOINIT method in the Main View
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Although Navigation Plugs are the correct normal approach, please note that there is also a pure coding approach also. This way not all navigation plugs have to be defined in advance, allowing for really dynamic navigation. For this you can use the method do_dynamic_navigation of the view API:
data:
l_api_main type ref to if_wd_view_controller.
data: target_component_name type string,
target_view_name type string,
source_plug_name type string.
l_api_main = wd_this->wd_get_api( ).
try.
l_api_main->do_dynamic_navigation(
source_window_name = 'MAIN'
source_vusage_name = 'MAIN_VIEW_USAGE_1'
source_plug_name = source_plug_name
target_component_name = target_component_name
target_view_name = target_view_name
target_plug_name = 'DEFAULT'
target_embedding_position = 'MAIN_VIEW/VIEW_CONTAINER').
.
catch cx_wd_runtime_repository .
raise exception type cx_wdr_rt_exception.
endtry.
This method even allows you to call external components without declaring a component usage.
HI Thomas Jung,
This is very helpful! Thank you very much all the same!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi Vikranth, it's great! Thank you!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
98 | |
11 | |
11 | |
10 | |
10 | |
8 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.