Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 8627

Re: How to set value for dropdown by key?

$
0
0

Hi Daro,

If I understand correctly the requirement is to default the value in dropdown based on the number you will enter inthe input field. For eg if you enter 20, you want 'Twenty' as default value in dropdown.

 

If you are still facing the problem, try the below code in onactionset method.

 

  DATA : LO_ND TYPE REF TO IF_WD_CONTEXT_NODE,

         LO_EL TYPE REF TO IF_WD_CONTEXT_ELEMENT,

         lv_yr_start TYPE wd_this->element_input-zzyear_start.

 

 

 

  LO_ND = WD_CONTEXT->GET_CHILD_NODE( name = WD_THIS->wdctx_input ).

  lo_el = lo_nd->get_element(   ).

* retrieve value from input context

  lo_el->get_attribute(

           Exporting

               name = 'ZZYEAR_START'

           Importing

               value = lv_yr_start  ).

 

LO_ND = WD_CONTEXT->GET_CHILD_NODE( WD_THIS->wdctx_year ).

LO_EL = lo_nd->get_element(   ).


* Set in dropdown context

lo_el->set_attribute(

  name = 'ZZYEAR'

  value = lv_yr_start  ).

 

Hope this helps.

Regards,

Sonia.


Viewing all articles
Browse latest Browse all 8627

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>