cancel
Showing results for 
Search instead for 
Did you mean: 

How to Clear an Item List Box

Former Member
0 Kudos

I know this sounds like a simple question, but I cant seem to find a solution.

I have a list box that fills when i select an item from a dropdown. With every new selection from the dropdown, the list box gets bigger and bigger(existing items aren't removed first).

How do I clear the list box before I repopulate it?

thanks in advance

Anton Kruse

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Anton,

Say, you List box is bound to context node MyListBoxNode.

Seems that you are adding elements to this node manually in onSelect handler of dropdown using wdContext.nodeMyListBoxNode().addElement(...)

If so, then just before adding elements call

wdContext.nodeMyListBoxNode().invalidate();

Valery Silaev

SaM Solutions

http://www.sam-solutions.net

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Anton,

In onSelect action of dropdown invalidate the listbox node element.

wdContext.nodeListBox.invalidate();

This will clear your listbox node before populating with the next values.

Former Member
0 Kudos

Wow!

It takes only 155 minutes to paraphrase my answer! )

VS