Skip to Content
0
Former Member
Jul 09, 2008 at 08:21 AM

Adding Tab Page Dynamically

154 Views

Hi Experts,

I'm now able to create a new tab page (cl_wd_tab) dynamically for a tab strip (cl_wd_tabstrip), and in the tab page, I created a View Container (cl_wd_view_container_uielement).

* create tab
  lr_tab = cl_wd_tab=>new_tab(
           id = c_tab_change_request
           view = lr_view ).
* create tab caption
  lr_caption = cl_wd_caption=>new_caption(
            id = c_cap_change_request
            view = lr_view
            text = 'Change Request' ).
* set caption
  lr_tab->set_header( lr_caption ).

* create view container
  lr_content = cl_wd_view_container_uielement=>new_view_container_uielement(
                 id = c_change_request_container
                 view = lr_view ).

* set view container
  lr_tab->set_content( lr_content ).

*  add tab
  lr_tabstrip->add_tab( lr_tab ).

After this, I tried to embed a component to the View Container, and this also works.

lr_component_usage = lr_component_usage_group->add_component_usage(
      name = c_requestdoc_usage
      embedding_position = embedding_position
      used_component = 'Used_Component' ).

but to show the embeded component, it seems that I have to perform a dynamic navigation

view->do_dynamic_navigation(
   source_window_name        = lr_window_controller->name
   source_vusage_name        = l_view_usage_name
   source_plug_name          = 'TO_CHANGE_REQUEST'
   target_component_name     = 'GRFN_MDCHG_REQUEST_DOC'
   target_component_usage    = c_requestdoc_usage
   target_view_name          = 'MAIN_WINDOW'
   target_plug_name          = 'DEFAULT'
   target_embedding_position = embedding_position ).

and the problem is here for naviagtion...

The tab creation code is in WDOMODIFYVIEW method, but we cannot do navigation in it.

but I created the the tab, view container, and usage in WDOMODIFYVIEW. this means I have to do the navigation after WDOMODIFYVIEW...

I don't where is the correct place to do this navigation...

Edited by: Sylvos Cai on Jul 9, 2008 10:21 AM