Skip to Content
avatar image
Former Member

How to get the index of the clicked button on TOOLBARBUTTONCHOICE

Hello Experts,

I have used toolbarbuttonchoice and created the dropdown list of the buttons dynamically. now when any of the button is clicked i need to get the reference of the button to call appropriate code in the action, but i am unable to get the either the reference or index of the clicked button.

Please help.

Regards,

Kinshuk

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    avatar image
    Former Member
    Aug 22, 2007 at 02:33 PM

    Have a look on the map_on_action method. You can dynamically add a parameter which will be transfered to the action handler:

    CLEAR lt_parameters.

    <b>INSERT INITIAL LINE INTO TABLE lt_parameters ASSIGNING <param1>.

    <param1>-name = 'CE'.

    <param1>-type = 'r'.

    <param1>-object = lr_subelement.</b>

    lr_choice = cl_wd_menu_action_item=>new_menu_action_item( ).

    lr_choice->set_text( ls_auth-text ).

    <b> lr_choice->map_on_action( lt_parameters ).</b>

    In my case I transfer a context_element, but you can also use an integer which can be used in case in the action handler. In the action handler i just defined the import parameter CE type ref to if_wd_context_element.

    lt_parameters is typer if_wd_event=>parameters.

    Cheers,

    Sascha

    Message was edited by:

    Sascha Dingeldey

    Add comment
    10|10000 characters needed characters exceeded

  • Aug 22, 2007 at 02:33 PM

    You can use parameter mapping in this case. Check pass-object-via-maponaction it has some code inside.

    Add comment
    10|10000 characters needed characters exceeded