Skip to Content
avatar image
Former Member

how to hide a ui element at run time

hai all,

can any one plese tell me how to hide an UI Element at run time.

thanks & regards

SREEVATHSAVA.G

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

7 Answers

  • avatar image
    Former Member
    Jun 25, 2009 at 10:50 AM

    hi SREEVATHSAVA ,

    you can set the properties for UI element by calling set_attribute_property

    * call method set attribute property and pass value as 'X' to ENABLE 
     DATA lo_el_radio_node2_1 TYPE ref to if_wd_context_element. 
      call method lo_el_radio_node2_1->set_attribute_property
        exporting
          attribute_name = 'FIRST_NAME_2'
          property       = 4
          value          = 'X'.

    Thanks ,

    chinnaiya P

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jun 25, 2009 at 10:53 AM

    Hi,

    For hiding any UI element, you have to create a context attribute of type WD_BOOLEAN(char 1), bind this context attribute to the 'VISIBLE' properly of UI element.

    Now for hiding, you have to set the context attribute value to SPACE and if you want to get it back displayed, set the same to 'X'.

    Regards,

    Manne.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jun 25, 2009 at 10:54 AM

    Hi,

    Is your uielement a static? If so, follow these steps;

    1. Create an attribute say 'VISIBLE' type boolean

    2. Bind this attribute to the visible property of the uielement

    3. Now when you want to hide it , set the 'VISIBLE' attribute to abap_false

    l_elem->set_attribute( exporting name  = 'VISIBLE'
                                     value = abap_false ).

    Regards,

    Radhika.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jun 25, 2009 at 11:02 AM

    Hi,

    Make use of WDUI_VISIBILITY.

    take a context node attribute of type WDUI_VISIBILITY, bound the same to VISIBLE property of the UI element.

    Use the below code.

    call method elem_visible->set_attribute

    exporting

    name = 'VISIBLE'

    value = '01'.

    Add comment
    10|10000 characters needed characters exceeded

  • Jun 25, 2009 at 11:11 AM

    Hello SREEVATHSAVA,

    to reach your aim you could use the standard hook method WDDOMODIFYVIEW of your view.

    For example, to hide button "BUTTON_1" (ID), the following code should help you :

    method WDDOMODIFYVIEW .
    
      data: LR_BUTTON            type ref to CL_WD_BUTTON.
    
      LR_BUTTON ?= view->GET_ELEMENT( 'BUTTON_1' ).
    
      LR_BUTTON->SET_VISIBLE( VALUE = '01' ).
     
    endmethod.
    

    Hope that helps,

    Peter

    Add comment
    10|10000 characters needed characters exceeded

  • Jun 26, 2009 at 06:38 AM

    Hi,

    This link will give u a clear idea

    [Making attribute invisible;

    regards

    sajid

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jul 06, 2009 at 05:59 AM

    thanks

    Add comment
    10|10000 characters needed characters exceeded