cancel
Showing results for 
Search instead for 
Did you mean: 

Change text and action of button in table ui

Former Member
0 Kudos

Hi all,

I have table ui with 4 columns, the fourth column is of button.

I want change the text of button and action for that button based on status which is 3rd column of table.

for example:

if status = A then button text should be 'Reset' and if status = B then Button text should be'Release'.(also the action for those buttons).

can anyone suggest how to achieve this.

Thanks all in advance

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member184578
Active Contributor
0 Kudos

Hi.,

Create two methods one for Reset and other for Release in your methods tab.,

Now in onAction Of your button Event.,

read the status using get attribute method.,

if lv_status = A.

wd_this->Reset().

elseif lv_ststus = B.

wd_this->release( ).

endif.

Similarly bind the text of button to attribute.,

if ststus = A

set_attribute(

attribute_name = 'Button Text

value = 'Reset' ).

else.

set text to Release.

hope this helps u.,

Thanks & Regards,

Kiran

Former Member
0 Kudos

Thank u..

i am getting the text but wat about action..

should i write action in modify view?

saravanan_narayanan
Active Contributor
0 Kudos

Hello Vani,

I would suggest to use the same action and in the action handled method, differentiate your logic based on the context attribute value. This solution is much simpler.

BR, Saravanan

former_member184578
Active Contributor
0 Kudos

Hi.,

No need to change action. In the same action based on status you can differentiate.,

if status = A

do coding for reset.

or create method and place code for reset and call that method

like wd_this->reset().

elseif status = B.

do coding for release.

or create method and place code for release and call that method

like wd_this->release().

hope this helps u.,

Thanks & Regards,

Kiran