on 09-12-2014 3:29 PM
Hi,
I have an URL parameter, based on what I do a dynamic navigation
wd_this->wd_get_api( )->if_wd_navigation_services~do_dynamic_navigation()
in the WINDOW DEFAULT inbound plug.
However the navigation is overridden by what is set as a default view in the WINDOW tab.
I tried
lr_window_controller = wd_this->wd_get_api( )->get_embedding_window_ctlr( ).
lr_rr_window = lr_window_controller->get_window_info( ).
lr_view_usage = lr_rr_window->get_view_usage( 'MAIN_USAGE_0' ).
lr_view_cnt_assignment = lr_view_usage->get_view_cnt_assignment( 'FUNC_VCA_1' ).
lr_view_cnt_assignment->set_default_view_usage( 'NOTDEFAULTVIEW_USAGE_1' ).
but not helping, still the default view is appearing. FUNC_VCA_1 in the above code is a view_container, I am trying to set a view active inside that view container.
Any ideas?
Thanks!
Guys, there are some confusions here. Take the following case:
1) Embed both COMP_A/VIEW_A and COMP_B/VIEW_B into a view container, and set COMP_A/VIEW_A as default
2) Create a navigation between outbound plug TO_VIEW_B and inbound plug COMP_B/VIEW_B default plug
3) In WINDOW default, based on a parameter wd_this->fire_to_view_b_plg( ).
This works, COMP_B/VIEW_B is visible!
Now remove the navigation link, remove COMP_B/VIEW_B from the window and enter the following code in the handlefeault:
wd_assist->m_akt_comp_usage = wd_this->wd_get_api( )->if_wd_navigation_services~do_dynamic_navigation(
source_window_name = 'WINDOW'
source_vusage_name = 'MAIN_USAGE_0'
source_plug_name = 'TO_VIEW_B'
* plug_parameters = lt_params
target_component_name = 'Z_WD_COMP_B'
target_component_usage = 'COMP_B_USAGE_1'
target_view_name = 'WINDOW'
target_plug_name = 'DEFAULT'
target_embedding_position = 'MAIN/VIEWCONTAINER'
).
NWhile I do get back the navigation link and inside do_dynamic_navigation there is a code to create the component and fire the plug, COMP_B/VIEW_B is not showing. Also please note, that if I do that on a button click it works. The problem is only inside handle default method.
Thanks!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I believe the problem is with
wd_this->wd_get_api( )->...
We are in the WINDOW handle default and wd_this here refers to the window, not the view, where the viewuielementcontainer resists.
If I create a TO_MAIN_VIEW and connect it with a newly created FROM_MAIN inbound plug in the MAIN view of the mans app and put the code there, then it is working, wd_this refers to the view.
So in the WINDOW handle default we have to somehow get the corresponding view api, where the components are to be embedded.
Hi,
When system reaches the DEFAULT plug, this is the first point of entry for the application and no views exist at this point of time.
I suggest you the below approach:
Hope this helps you.
Regards,
Rama
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Unfortunately not, I do navigation just fine in onActions, the problem here is that I need to navigate to a different view based on an URL parameter. I parse this URL parameter and navigate to view B_VIEW, but since in the window the default view is A_VIEW, that is shown and I cannot make B_VIEW appear.
No, you can do that, otherwise you could not navigate onto a different view in the same view container by clicking a window.
1) Create a WebDynpro app with a component, window, view
2) Create two other components COMP_A/VIEW_A and COMP_B/VIEW_B
3) Create a view container in the original view and its window ember both COMP_A/VIEW_A and COMP_B/VIEW_B
4) One of the view is set to default (yellow line), COMP_A/VIEW_A
If I start the app then COMP_A/VIEW_A is visible.
If I fire a plug to VIEW_B in the default inboug plus then VIEW_B becomes visible.
Now since I want to do this dynamically there are no navigations, I do that with do_dynamic_navigation. In the source code of do_dynamic_navigation, it creates the component, creates links and fires the plug.
However despite the do_dynamic_navigation to COMP_B/VIEW_B it's not showing, but COMP_A/VIEW_A is showing.
If I do this dynamic navigation on a button click it's fine. It's just not working in the app window default plug.
Hi Karloy,
I think you missed my point that is what i am trying to say when you go to windows under window you find your view if you right click on that you get an option set as default so now when you set it as default every time you start ur dynpro it will come by default, now how can you override that pls suggest, it can be helpful to me as well.
thanks.
Hi,
Create 2 different outbound plug and their respective target view being A_VIEW & B_VIEW. In your window, embed Empty view and make it as default view. But, In the Window Default event handler method, fire outbound plug, based on type of URL parameter value you read.
Hope this helps you.
Regards,
Vishnu
Hi,
Unfortunately I cannot do that, since all is dynamic there is no view to set as default, it's done in the source code:
wd_assist->m_akt_comp_usage = wd_this->wd_get_api( )->if_wd_navigation_services~do_dynamic_navigation(
source_window_name = 'WINDOW'
source_vusage_name = 'MAIN_USAGE_0'
source_plug_name = 'TO_VIEW_B'
* plug_parameters = lt_params
target_component_name = 'Z_WD_COMP_B'
target_component_usage = 'COMP_B_USAGE_1'
target_view_name = 'COMP_B'
target_plug_name = 'DEFAULT'
target_embedding_position = 'MAIN/VIEWCONTAINER'
).
Thanks!
Hi,
You can still use the same navigation technique to achieve your requirement as well.
Please follow the below steps:
Define Navigation links static
Define Navigation Links dynamic
Please refer the document suggested earlier, in your case define the triggering point from window based on URL parameter
Hope this helps you.
Regards,
Rama
User | Count |
---|---|
85 | |
10 | |
10 | |
10 | |
7 | |
6 | |
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.