167
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
UserImage.jpg
Nani
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
2024-09-27 19-05-42
Ravi Kumar Tasubilli

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

2018-10-29 08-31-03
João Marques
 
MVP

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

2021-06-01 05-56-33
Komal Kumbhar

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

UserImage.jpg
Ravi Kumar Tasubilli

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.

2021-06-01 05-56-33
Komal Kumbhar

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 ),


UserImage.jpg
Ravi Kumar Tasubilli

Yes you are right. 

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

UserImage.jpg
Nani
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
2024-09-27 19-05-42
Ravi Kumar Tasubilli

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.