cancel
Showing results for 
Search instead for 
Did you mean: 

how to capture selected value from drop down by index

Former Member
0 Kudos

Dear friends,

i want to capture the value of select value from drop down by index, for eg if  select air france, how to capture , could any one please let me know

Thanks

Vijaya

Accepted Solutions (1)

Accepted Solutions (1)

ramakrishnappa
Active Contributor
0 Kudos

Hi Vijaya,

You can get the value of selected from drop down as below


  • Check out the event handler method attached to Onselect event of the ui element drop down by index , if no event is associated, then create an event and attach to the drop down list
  • Now you will be having the CONTEXT_ELEMENT in the WDEVENT parameter

               data lo_element type ref to if_wd_context_element.

              

               lo_element = wdevent->get_context_element( name = 'CONTEXT_ELEMENT').

  • Now, you can get the static attribute value of selected  drop down value & let us say your drop down list values are populated from context node 'ND_DRP_DOWN'

               data ls_data type wd_this->element_nd_drp_down.

              

                         lo_element->get_static_attributes(

                                   importing

                                   static_attributes = ls_data ).

Hope this helps you.

Regards,

Rama

Former Member
0 Kudos

Thanks Ram

Answers (1)

Answers (1)

former_member222068
Active Participant
0 Kudos

Hi Lakshmi,

Create an action for the onselect event. and implement the following logic

data: lo_nd_ddix type ref to if_wd_context_node,

         lo_el_ddix type ref to if_wd_context_element,

         ls_ddix     type wd_this->element_ddix.

lo_nd_ddix = wd_context->get_child_node( 'DDIX' ).

lo_el_ddix = wdevent->get_context_element( 'CONTEXT_ELEMENT' ).

lo_el_ddix->get_attribute( exporting name 'ATTRIBUTE' importing value = lv_ddix ).

or

lo_el_ddix->get_static_attributes( importing static_attributes = ls_ddix ).

Hope this should help you.

Thanks & Regards,

Sankar Gelivi