cancel
Showing results for 
Search instead for 
Did you mean: 

Dis-Appear of Buttons

Former Member
0 Kudos

In my application when i click on a button that button (clicked one) should be disappeared and a new one should be appeared . Any one help me regarding this issue.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi rahul,

simple one is to declare two attributes in the context of type wdy_boolean. bind the first attribute to the first button's visibility. likewise for the second.

On action of that first button, set the attribute of the visibility of the second button as abap_true and make the attribute of the visibility of the first button as abap_false.

Regards...

Arun.

Former Member
0 Kudos

hi Arun,

my problem is that when i click on the first button then two actions have to be performed

1) second button should appear

2) first button should disappear .

I am able to do the first operation but i am not able to do the second one.

Edited by: rahul nuthi on May 29, 2008 3:28 PM

Former Member
0 Kudos

Hi

u can create two attrbutes of type wdui_visibility.

say visible_one and visible_two.

now bind the first attribute to the visible property of the first button and second attribute to the visible property of the second button.

In the context for first attribute give the default value has '02'.

so initially ur first button is visible and second one is invisible.

then when you click on the button. in the onaction method

set the value for the attributes as:

lo_el_element->set_attribute

visible_one = '01' " it makes it invisible"

and

lo_el_element->set_attribute

visible_two = '02' " it makes it visible"

regards

chythanya

Former Member
0 Kudos

hi rahul,

1) declare two attributes like visible1 and visible2 with type wdy_boolean in the context and make the the default value for visible1 as X.

2) bind these attributes to the visibility of the two buttons.

In properties u can find a visible property for the button.

3) On action of the first button, create a method.

In that one write this code.

DATA lo_el_context TYPE REF TO if_wd_context_element.

DATA ls_context TYPE wd_this->element_context.

DATA lv_visible2 TYPE wd_this->element_context-visible2.

DATA lv_visible1 TYPE wd_this->element_context-visible1.

lo_el_context = wd_context->get_element( ).

lo_el_context->set_attribute( name = `VISIBLE2`

value = 'X' ).

lo_el_context->set_attribute( name = `VISIBLE1`

value = ' ' ).

Hope ur query is answered.

Regards...

Arun.

Former Member
0 Kudos

thank u guys.

Regards,

Rahul

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

u can create an attribute of type wdui_visibility and bind this attribute to the visibility property of the button.

on the action of the button(which is triggered on clicking the button), you can set the value for attribute as '02' which means visible.