cancel
Showing results for 
Search instead for 
Did you mean: 

How to add a event to a dynamic created input field in web dynpro?

Former Member
0 Kudos

Hi,

i created "dynamic" a ui element, now i would add e event, i dont know how, but i had searched on diffrent places, but i get no info.

I only read something about add_eventhandler and to registrated a evendhandler. I couldnt believe that this is the correct way.

Here the code for a selection_field...:

  lt_range_table = wd_this->go_so->CREATE_RANGE_TABLE( i_typename = '/BVCCSAP/VE_BCOD1' ).
  wd_this->go_so->add_selection_field(

      i_id = 'BCODE'
       it_result = lt_range_table
       i_description = 'Barcode'
       i_no_intervals = abap_true
      i_read_only = read_only

).

Thanks a lot for your help and hints

Alex

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Alexander,

Refer this below links which might give any idea.

Dynamic UI Generation in Web Dynpro ABAP

Creating UI Elements Dynamically in Abap Webdynpro Application

Thanks

KH

Former Member
0 Kudos

Hi Katrice,

thanks for the 2 links, the first link works and the second i get a 404 page error..

Do i missunderstand this, i checked the first link and i never saw a line where i can assign a eventhandler.

If i do this with the layout designer, i add the input field, then i have some options and one options is onEnter. But i not saw this, sorry..

I saw that i have to create the input field like this

CALL METHOD cl_wd_input_field=>new_input_field and to set_enter a event, but i havent found a example, do you now a good one....to understand this...

thanks a lot

Alex

Former Member
0 Kudos

Therer are two ways you can assign an action to the "OnEnter"-event of your input field:

1. in method cl_wd_input_field=>new_input_field you have the parameter:

ON_ENTER

You just have to assign your action name to this field and it will be called on the OnEnter-event of your InputField.

e.g:

     lr_input_field = cl_wd_input_field=>new_input_field(

                                             id = 'INP_MY_INPUT_FIELD'

                                             on_enter = 'MYACTION'

                                             ).

2. You can use the method SET_ON_ENTER.

like:

     lr_input_field->set_on_enter( 'MYACTION' ).

Just make sure, you have created and implemented this action and its handler.

Former Member
0 Kudos

Hi Kai,

     thanks a lot,

     was very helpful,

     thanks a lot,

kind regards

Alex

Answers (0)