Expand my Community achievements bar.

SOLVED

Removing Items from Populated List-Box

Avatar

Level 3

I have a drop down box populate a list box. (change: ListBox1.addItem(xfa.event.newText)) But I can add more then one of the same selection so how do I remove them from the ListBox. Upon click? somehow? I don't konw the lingo.

1 Accepted Solution

Avatar

Correct answer by
Former Community Member

There is a selectedIndex property that will give you back the index of the 1st item that is selected.

Paul

View solution in original post

8 Replies

Avatar

Level 3

also If i allow custom text in the drop down box. It adds each letter that i type. How do i only allow upon pressing enter or something

Avatar

Former Community Member

You probably have your code on the change event .....move it to the exit event.

Paul

Avatar

Level 3

I see the delteItem but I get an error wherever i put it. Am i using the wrong code: ListBox1.deleteItem

Avatar

Former Community Member

It requires an index of the item that you want to delete

Paul

Avatar

Level 3

How does the index be what is selected or clicked on?

Avatar

Correct answer by
Former Community Member

There is a selectedIndex property that will give you back the index of the 1st item that is selected.

Paul

Avatar

Level 3

Thanks this seems to work. I put a dummy "remove" button next to it so people think to highlight and then click off.

The following has evaluated to null or missing: ==> liqladmin("SELECT id, value FROM metrics WHERE id = 'net_accepted_solutions' and user.id = '${acceptedAnswer.author.id}'").data.items [in template "analytics-container" at line 83, column 41] ---- Tip: It's the step after the last dot that caused this error, not those before it. ---- Tip: If the failing expression is known to be legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)?? ---- ---- FTL stack trace ("~" means nesting-related): - Failed at: #assign answerAuthorNetSolutions = li... [in template "analytics-container" at line 83, column 5] ----