cancel
Showing results for 
Search instead for 
Did you mean: 

Hiding tab in tabstrip

Former Member
0 Kudos

Hi Forum,

I have tabstrip in my application. I want to hide a tab during run time. I binded the visibility property of tab with an attribute of wdy_boolean type and set that to abap_false. The contents gets invisible but empty tab still remains visible. How to make the complete tab invisible. Please help me out.

Thanks,

Mallika

Accepted Solutions (0)

Answers (3)

Answers (3)

former_member40425
Contributor
0 Kudos

Hi,

Create a attribute of type wdy_boolean and bind it with the visibility property of tab.

Set it ' ' to make it invisible and set it to 'X' to make it visible.

I hope it helps.

Regards,

Rohit

Former Member
0 Kudos

hi,

*It wont work with Wdui_visibility.

For hiding a tab, make context attribute of type Char1.

Because the binding property VISIBLE for Tabstrip is the checkbox. So it can store space or X in to that. Then only it will effect to visibulity. Not 01 or 02 what you will do for input fields and others.

here CA_VIS is attribute of type char1.

DATA lo_el_context TYPE REF TO if_wd_context_element.

DATA ls_context TYPE wd_this->element_context.

DATA lv_ca_vis LIKE ls_context-ca_vis.

  • get element via lead selection

lo_el_context = wd_context->get_element( ).

  • get single attribute

lo_el_context->set_attribute(

  • EXPORTING

name = `CA_VIS`

  • IMPORTING

value = ' ' ).

For making it visible give X in CA_VIS.

It will work.

If you use Wdy_boolean then also it should work.

Try giving ' ' for making it invisible and 'X' for making it visible.

Edited by: Saurav Mago on Oct 8, 2009 6:43 PM

Former Member
0 Kudos

hi,

instead of binding it to the attribute of wdy_boolean , bind it to the attribute wdui_visibility

u can declare a context attribute of type wdui_visibility and bind its(UI element's) VISIBLE property with this attribute

set the attribute value to 01 to make the table invisible



   DATA lo_nd_cn_visiblesuper TYPE REF TO if_wd_context_node.
    DATA lo_el_cn_visiblesuper TYPE REF TO if_wd_context_element.
    DATA ls_cn_visiblesuper TYPE wd_this->element_cn_visiblesuper.
    DATA lv_ca_visible LIKE ls_cn_visiblesuper-ca_visible.
*   navigate from <CONTEXT> to <CN_VISIBLESUPER> via lead selection
    lo_nd_cn_visiblesuper = wd_context->get_child_node( name = wd_this->wdctx_cn_visiblesuper ).
 
*   get element via lead selection
    lo_el_cn_visiblesuper = lo_nd_cn_visiblesuper->get_element(  ).
 
*   get single attribute
    lo_el_cn_visiblesuper->set_attribute(
      EXPORTING
        name =  `CA_VISIBLE`
   
        value = '01').

u can set this attribute :

01- To make it invisible

02 - To make it visible.

here I have created a attribute ca_visible under node cn_visiblesuper of type wdui_visibility type ,which I am setting to 01

to make table invisible this is binded to VISIBLE property of ur table UI

instead of setting the context attribute value to '01' and '02' , u can also proceed by this way:

wd_context->set_attribute( name = '<attribute name>' value = if_wdl_core=>visibility_visible )." to make it visible.

wd_context->set_attribute( name = '<attribute name>' value = if_wdl_core=>visibility_none ). "to make it invisible

I hope it shud help

rgds,

Edited by: amit saini on Oct 8, 2009 2:37 PM