cancel
Showing results for 
Search instead for 
Did you mean: 

How to remove all the elements from a Dropdownbyindex

Former Member
0 Kudos

Hi all,

I have a dropdown which is populated using a BAPI. based on some condition i need to refresh the dropdown and fill with new items. How can i remove all the items from a dropdown?

Thanks in advance

regards,

Sujesh

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

sujesh,

find node DropDown is bound to (via texts property). Then invoke node.invalidate().

VS

Answers (1)

Answers (1)

Former Member
0 Kudos

sujesh,

If my previous suggestion doesn't work (and this is the case with Adaptive RFC model and nodes with supplyingRelationRole set) then just do not remove elements explicitly -- just re-execute your BAPI.

VS

Former Member
0 Kudos

Hi,

Thanks for the reply,

In this case, the dropdown is not directly populated by a BAPI. We store the results in a valueNode and then populate it in to the dropdown based on various filtering criteria. So when the user changes the condition the dropdown values populated previously should go off and should get populated again with nw values(number of items also will differ based on the condition)

Ideally i would need a solution through which i should be able to delete all the items from the dropdown

Any help?

Thanks

Sujesh

Former Member
0 Kudos

Sujesh,

why dont you use a value node and a value attribute for the dropdown ? As soon as the user makes any changes, you invalidate this node and fill it with required elements ?

I hope this works for you.

Regards

Kapil

Former Member
0 Kudos

Hi,

If your context structure looks like this:

-Root

--SomeValueNode

---Text (value attribute, bound to "texts" property of dropdown)

Then you wil need to invalidate this node for deleting all previous values of the dropdown. So your code should look like:


wdContext.nodeSomeValueNode().invalidate();

Regards,

Satyajit.