cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamically set an explanation text for a button?

0 Kudos

Hi, is there anyone who knows if it's possible to set an explanation text dynamically for a button?

I would like to give the user different help texts for different buttons. Button number one in my view could both be a button for action A and action B which is set dynamically (different actions are called depending certain circumstances). But I also would like to give the user different explanations /help text when the user points with the mouse over the button. It's not possible to bind this property to a context attribute, I have to give an OTR text. Could I set this OTR text dynamically in any method, which method?

Anyone who knows if it's possible?

Thank you and regards Lena

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Lena,

WDDOMODIFYVIEW is the method where you have to do any modification on the view. You do as following.

1. Create an attribute in the context which stores whether button action is A or B.

2. In wddomodifyview check whether its A or B.

3. Get the reference to the button as follows.

data:

     but type ref to cl_wd_button.

    

     but = view->get_element ( 'BUTTON_NAME' ).

     but->set_tooltip( ) <---------- You can set the tooltip of the button

Regards,

Fareez

0 Kudos

I got a question, what class do I use for the view in view->get_element( 'BUTTON_NAME' )?

regards Lena

Former Member
0 Kudos

Hi Lena,

VIEW is a parameter in wddomodifyview. You don't have to declare that. It is of type IF_WD_VIEW.

Regards,

Fareez

Answers (1)

Answers (1)

Former Member
0 Kudos

hI

1. I think the best way is to use the tool tip.

2. The tooltip is one of the propertiers of the button.

3. Bind the tooltip attribute to context and use OTR to change the text

4. To change the properties of a UI element you have to put your code in WDDOMODIFYVIEW

      of the view controller

regards

yuval peery