cancel
Showing results for 
Search instead for 
Did you mean: 

Tabstrip in WebDynpro

Former Member
0 Kudos

Hi,

I am Displaying 4 checkboxes in the intiali screen.

In the second screen tabstrip control with 4 tabs will be displayed.

Each tab visibilty is binded to One Atrbute of type WDY_BOOLEAN seperately.

Now, in the initialization of second Screen. I am writing the code for modyfying the view.

If first check box is selected, then I am setting the fisrt tab visibility attribute as 'X'.

I am doing the same for second and third and fourth also.

But, For evry case, all the TABS are getting displayed.

I tried by taking WDUI_VISIBILITY type by setting value as '02' also.

But, no changed.

Please let me know how can I do this.

Regards

Sandeep Reddy

Accepted Solutions (1)

Accepted Solutions (1)

uday_gubbala2
Active Contributor
0 Kudos

If you follow all these steps then you should be able to resolve your problem.

Regards,

Uday

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi Uday,

I am very thankfull for the detail Explaination...But I am using CheckBox group not individual checkbox..so can you please tell me how can Do this now?

Regards

Sandeep

uday_gubbala2
Active Contributor
0 Kudos

Now lets come back to our MAIN view. I create an action (CHECK_STATUS) for the "onToggle" event of the checkbox. I map the same action to all the 3 checkboxes (CHECK1, CHECK2 & CHECK3) So now whenever the user toggles the checkbox the code snippet below would get executed:

METHOD onactioncheck_status .
  DATA: lv_name TYPE string,
        lv_state TYPE wdy_boolean,
        wd_node TYPE REF TO if_wd_context_node.

  wd_node = wd_context->get_child_node( name = 'VISIBILITY' ).

" first we need to determine which checkbox has been toggled
" after executing the below statement lv_name would have either C1, C2 or C3
" these are the ID's that I have assigned to the checkboxes in my MAIN view

  lv_name = wdevent->get_string( 'ID' ).

" Next we need to know whether the checkbox has been checked/unchecked
  lv_state = wdevent->get_string( 'CHECKED'  ).

  CASE lv_name.
    WHEN 'C1'.
      IF lv_state = 'X'.
        wd_node->set_attribute( EXPORTING name  = 'TAB1'
                                          value = 'X' ).
      ELSE.
        wd_node->set_attribute( EXPORTING name  = 'TAB1'
                                          value = 'X' ).
      ENDIF.

    WHEN 'C2'.
      IF lv_state = 'X'.
        wd_node->set_attribute( EXPORTING name  = 'TAB2'
                                          value = 'X' ).
      ELSE.
        wd_node->set_attribute( EXPORTING name  = 'TAB2'
                                          value = 'X' ).
      ENDIF.
    WHEN 'C3'.
      IF lv_state = 'X'.
        wd_node->set_attribute( EXPORTING name  = 'TAB3'
                                          value = 'X' ).
      ELSE.
        wd_node->set_attribute( EXPORTING name  = 'TAB3'
                                          value = 'X' ).
      ENDIF.
  ENDCASE.
ENDMETHOD.

uday_gubbala2
Active Contributor
0 Kudos

Now in order to control the visibility of the tabs I have another context node VISIBILITY with 3 more attributes (TAB1, TAB2 & TAB3) of type WDY_BOOLEAN. I have also given them a default value of blank.

Now I map this VISIBILITY node to both my MAIN view & TABSTRIPVIEW. Within the tabstrip view I bind the "visible" property of each tab to the respective attribute.

ex:

I bind the tab TAB1 of the tabstrip with the attribute TAB1 of VISIBILITY

I bind the tab TAB2 of the tabstrip with the attribute TAB2 of VISIBILITY

I bind the tab TAB3 of the tabstrip with the attribute TAB3 of VISIBILITY

uday_gubbala2
Active Contributor
0 Kudos

Hi Sandeep,

Suppose I have 3 checkboxes with ID's C1, C2 & C3 in my MAIN view. I now need 3 attributes for binding their property "checked". I have a context node CHECKED which has 3 attributes (CHECK1, CHECK2 & CHECK3) of type WDY_BOOLEAN. I have given all these 3 attributes a default value of blank i.e, all the 3 checkboxes would be unchecked by default.