cancel
Showing results for 
Search instead for 
Did you mean: 

How to change the design of a button programatically in WDA?

Former Member
0 Kudos

Hi experts,

  I am creating a webdynpro application, in that there are two buttons 'SHOW ALL' and 'SHOW CURRENT'.  Is it possible to change the design of these buttons using program? If yes pls give the solution.

Thanks in advance,

Pradeep

Accepted Solutions (1)

Accepted Solutions (1)

Abhinav_Sharma
Contributor
0 Kudos

Hi Pradeep,

There is a design property of the button. You can bind the design property with context attribute of type WDUI_BUTTON_DESIGN. It has following values -

00 standard

01 emphasized

02 previous

03 next

Set the attibute value to one of these and you can change the design at runtime. Thanks!

Regards

Abhinav

Former Member
0 Kudos

Hi

I have created the following context attributes.

Of type

And I have done the following code also.

* get element via lead selection

  lo_el_context = wd_context->get_element( ).

* @TODO handle not set lead selection

  IF lo_el_context IS NOT INITIAL.

     lv_emphasise_all = 01.

     lo_el_context->set_attribute(

       name =  `EMPHASISE_ALL`

       value = lv_emphasise_all ).

  ENDIF.

* get element via lead selection

  lo_el_context = wd_context->get_element( ).

* @TODO handle not set lead selection

  IF lo_el_context IS NOT INITIAL.

     lv_emphasise_current = 00.

   lo_el_context->set_attribute(

    name =  `EMPHASISE_CURRENT`

    value = lv_emphasise_current ).

  ENDIF.

Still it is not working, I am getting the same output.

Please help.

Abhinav_Sharma
Contributor
0 Kudos

Hi Pradeep,

It should work. Where you have written this code. Also can you replace your code with following

lo_el_context->set_attribute( 

    name =  'EMPHASISE_CURRENT'

    value = '00' ).

  lo_el_context->set_attribute( 

       name =  'EMPHASISE_ALL'

       value = '01'  ).

There should be a round trip to change the design. Thanks!

Regards

Abhinav

Former Member
0 Kudos

Thanks Abhi..

It is  working now

Regards,

Pradeep

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Pradeep,

In addition to Abhinavs reply, you can change image source property by adding some icons. Press F4 on image source you will get all icons. check once.

Cheers,

Kris.

former_member210266
Active Participant
0 Kudos

Hi Pradeep

Yes its possible.

You need to create context attribute and bind the text (or image whatever you want to change at run time) property with the context attribute.

Then you can assign the value of the context attribute at run time.

Regards

Swati