cancel
Showing results for 
Search instead for 
Did you mean: 

How to clear a drop down by key on a button action

Former Member
0 Kudos

Hi All

I am new to the webdynpro i have to clear the dropdown by key, i had tired giving the

wdContext.nodeA().invalidate();

on a button action which will navigate to next view after click but it doesn't effect when i come back to the first view can any one help me in doing this.

Regards

Ashwin

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

You say "dropdown by key", so the selectedKey property of this control is bound to some context attribute, and the dropdown values are given from IModifiableSimpleValueSet,

(attributeInfo.getModifiableSimpleType()).

In order to clear this valueset, just call .clear() method.

In order to clear selection, set null to corresponding attribute.

Former Member
0 Kudos

What do you mean by "clear", do you mean clearing the selection or clearing the item list?

Armin

Former Member
0 Kudos

Hi Ashwin,

To display the values in DropDownbyKey, yuo need to populate the value in the node before the view is rendered to the user. So must be populating the node in the wddoinit method the view controller or the component controller.

Now just for your knowlegde, DropDownbyKey just holds the one value which is selected by the user, and all other values are automatically invalidated by the framework. So invalidate methos is a wrong choice in this case. You can probably use the function module SET_STATIC_ATTRIBUTES_NULL for a element. For further info you can check IF_WD_CONTEXT_ELEMENT in se24 transaction.

Hope this help.

Cheers !

Ashish

Former Member
0 Kudos

HI Ashwin.

Invalide will not work for dropdownbykey.inseted you can use dropdoenbyindex whichn solves your problem

With Regards

Naidu

monalisa_biswal
Contributor
0 Kudos

For Drop Down By Key you have to clear valueset of the value attribute.

ISimpleTypeModifiable simpleType = wdContext.wdGetAPI().getModifiableTypeOf("<ContextPath>");

IModifiableSimpleValueSet valueSet = simpleType.getSVServices().getModifiableSimpleValueSet();

valueSet.clear();