37
Views
7
Comments
Solved
Remove Selected ListItem from Dropdown
Question
Application Type
Reactive

I have a dropdown with list of users. if i got selected any one user that name should display on dropdown and i dont want to show the selected user on dropdown list.

I want to remove the selected user from list at the same time display on dropdown.

Please suggest how to achive this.

Thanks.


Screenshot 2023-09-26 132740.png
Solution

Hi, Ravi

The requirements you are asking for the Dropdown is not possible because if you remove a selected value in Dropdown showing list, it will not show the value which is selected.

But it will possible with the "search dropdown".

i have given the oml please go through it.

I hope this might match your requirements 

DropDown.oml

Thanks for your support. you did as per my requirement.

Hi Tasubili,


On dropdowns, when selecting them, on the right properties pane, you will see below the OnChange event. There you can add a screen action as a handler:



This event will be triggered when a value in the dropdown is selected. There you can define the logic you want to be ran once a dropdown value is changed.

In your case, you want, to pick up the user selected, add it to the selected user list, remove it from the dropdown list, and set the selected value of dropdown list to null, I believe.

You can do all this, by using simple assigns and using the List actions from System:

For instance, you can use the ListAppend to add an element to a list and ListRemove to remove an element from a list.


Kind Regards,
João

Hello,

https://www.outsystems.com/forums/discussion/91561/remove-items-in-dropdown-at-runtime/ 

kindly have a look at this post,

I have posted OML here as well as there is another solution, 

kindly check which one works for you,

Hope this solution work,

Komal

Hi, thanks for reply

here my screnario is different i am not saving any data after selecting from dropdown.

just i want to display the selected user on dropdown and at the same time i dont want to show that selected user in dropdown list.

i think its impossible because when i remove the selected user from dropdown list id not available so dropdown will not show the selected user.

Hey,

Please confirm my understanding here,

In the following screenshot If user has selected XYZ, then it shouldn't be part of list (2nd underlined ),


Yes you are right. 

And if i select "AAA". previous one "XYZ" should be add and "AAA" remove from list

Solution

Hi, Ravi

The requirements you are asking for the Dropdown is not possible because if you remove a selected value in Dropdown showing list, it will not show the value which is selected.

But it will possible with the "search dropdown".

i have given the oml please go through it.

I hope this might match your requirements 

DropDown.oml

Thanks for your support. you did as per my requirement.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.