We can display assignment blocks in tabs using thtmlb tag element “tabContainer” .

This will be useful where when we need to display assignment blocks in tab instaed of displaying it one by one in Overview page.

First step

we need to create Viewset for this and in .htm page use “tabContainer” tag to display tabs

Atributes:tabLinks is used to show the tabs values

               SelectedTabLinkId is used to show the selected tab link

Declare attributes TAB_LINK type CRMT_THTMLB_LINK_T and SELECTED_LINK TYPE string in implementation class

in .htm page we need this code for tab

<thtmlb:tabContainer id                    = “tc1”

                       design                = “TABS”

                       checkContent          = “FALSE”

                       tabLinks              = “<%= controller->TAB_LINK %>”

                       selectedTabLinkId     = “<%= controller->SELECTED_LINK %>”

                       noExcelDownloadButton = “TRUE”

                       noPersonalizeButton   = “TRUE”

                       noTableGraphicsButton = “TRUE” >

    <bsp:call comp_id = “<%= controller->GET_VIEWAREA_CONTENT_ID( ‘VIEWA’ ) %>”

              url     = “<%= controller->GET_VIEWAREA_CONTENT_URL( ‘VIEWA’ ) %>” />

  </thtmlb:tabContainer>

here we can use vieware “VIEWA’ to have all the (assignments blocks) views and we can display the view on select event of the tab

Second step:

For this we need to fill TAB_LINK and SELECTED_LINK attributes

fill tab links in DO_INIT_CONTEXT of the View set

DATA:

   ls_link TYPE crmt_thtmlb_link.

  REFRESH tab_link.
  CLEAR ls_link.
  ls_link-id      = ‘View1.                      “#EC NOTEXT
  ls_link-onclick = ‘VIEW1.                     “#EC NOTEXT
  ls_link-text    = ‘Tab1’.

APPEND ls_link TO tab_link.

  CLEAR ls_link.

  ls_link-id      = ‘View2               “#EC NOTEXT
  ls_link-onclick = ‘VIEW2’.                 “#EC NOTEXT
  ls_link-text    = ‘Tab2’.

  APPEND ls_link TO tab_link.

and selected_link = ‘View1’. “default tab.

Third step:

on tab click event VIEW1 and VIEW2 put code to navigate to the selected view

EH_ONVIEW1.

selected_link = ‘VIEW1’.

view_manager->navigate( source_rep_view = rep_view

                            outbound_plug = ‘ToView1’ ).

EH_ONVIEW2

selected_link = ‘VIEW2’.

view_manager->navigate( source_rep_view = rep_view

                            outbound_plug = ‘ToView2’ ).

create navigation link ToView1 and ToView2 with target views

Tabs.jpg

Regards,

Deepika.

To report this post you need to login first.

Be the first to leave a comment

You must be Logged on to comment or reply to a post.

Leave a Reply