cancel
Showing results for 
Search instead for 
Did you mean: 

DropDownByKey

Former Member
0 Kudos

My drop down element is bound to an attribute with input help mode set to automatic.

The type of input help is 'Fixed Values for Domain'.

The drop down is initially empty. Users select a value, but sometimes want to clear

the value after selecting one. But since it is bound to a domain with fixed input values

there is no option to clear the selected value.

Is there a way to configure this DropDown so the user can clear the selected value?

Accepted Solutions (1)

Accepted Solutions (1)

ChrisPaine
Active Contributor
0 Kudos

Hi Gregory,

I'd suggest the easiest way to do it would be to enhance the domain with the blank value (although depending on what the domain is and where it is used - that could be problematic for other functionality).

Otherwise, within the WDDOINIT of your controller I believe you can use code similar to the below to add a blank.

data: lo_nd_details type ref to if_wd_context_node,
        lo_details_info type ref to if_wd_context_node_info,
        ls_attribute_info type wdr_context_attribute_info,
        ls_value_set type wdr_context_attr_value.



  lo_nd_details = wd_context->get_child_node( name = wd_this->wdctx_details ).

  lo_details_info = lo_nd_details->get_node_info( ).

  ls_attribute_info = lo_details_info->get_attribute( 'GENDER' ).

  ls_value_set-value = '4'.
  ls_value_set-text = 'Requested but not disclosed'.

  append ls_value_set to ls_attribute_info-value_set.

  lo_details_info->set_attribute_value_set( name = 'GENDER'
                                            value_set = ls_attribute_info-value_set ).

Obviously this is an example only - don't put text in your code as literals - use the assistance class to provide the texts, but it should work..

(Gender was probably a bad example to use as the domain already has a blank value - but I added another value just to give you the idea).

Cheers,

Chris

Answers (0)