99
Views
13
Comments
Cant reselect a value in a dropdown after filtering

I am trying to get multiple dropdown that get filtered based on the value you selected on the dropdown previous of that. I have got the filter down but now when i try to reselect something that came out of that filter i cant select any of the items. 

testinghooooooo.PNG
2024-11-25 22-05-29
Sergio Aznar Guallar

Hi Jorginiho,

you can solve by fetching the aggregates on demand (all except of the first dropdown), and then using the On Change event of the dropdowns to refresh the aggregates

hope it helps


Kind regards,

Sergio

2024-11-25 22-05-29
Sergio Aznar Guallar

You have an example on how to implement it on this video:

How to build cascading or linked dropdowns in OutSystems?


UserImage.jpg
jorginiho wijnhard
2023-04-16 15-25-31
Krishnanand Pathak

Hi @jorginiho wijnhard 

Are your refreshing the aggregate on DropdownOnChange action ?
Maybe the issue is related aggregate refresh.

Regards

Krishnanand Pathak

UserImage.jpg
jorginiho wijnhard

Yes i am already refreshing the aggregates on change but the values inside the dropdown stay unclickable

UserImage.jpg
jorginiho wijnhard

I Just tried this but sadly no results it stays the same for me 

2024-12-10 04-40-04
Gitansh Anand

Hi @jorginiho wijnhard, There are two inputs in the dropdown: "Options text" and "Options Value" (refer to the image below). The issue that you are describing occurs when the value input bound with "Options Value" has the same value for multiple entries; in that case, the dropdown selects the first matching value.

Please check the dropdown list for multiple entries with the same value ("Options Value").

Thanks
Gitansh Anand

UserImage.jpg
jorginiho wijnhard

It is true that i am selecting multiple of the same value but how can i fix that problem then while still getting the results i want?

2024-12-10 04-40-04
Gitansh Anand

Hi @jorginiho wijnhard, I am adding an OML with a workaround. In this, I am adding a new attribute to the entity (named "NewAttributeForSolvingIssue" for ease of understanding), and this new attribute will not have any duplicate value. Then, on the screen (the "Test" screen in my OML), I have created a new variable ("NewVariableForSolvingIssue" for ease of understanding), which will be the new variable bound to the dropdown. Then, I created a handler for OnChange, and in that, I used a list filter to filter out the selected record from the aggregate and then assigned the filtered value to the ActualValue variable.

Thanks
Gitansh Anand

Test.oml
2022-02-25 19-42-59
Srinivas K Singadi

Hi jorginiho wijnhard

it seems like you have successfully implemented the filtering of the options in the dropdowns based on the selection in the previous dropdown. However, you are facing an issue where you cannot reselect an item that was previously filtered out.

One possible reason for this issue could be that the filtered options are not being reset when the previous dropdown value is changed. As a result, the previously filtered options remain hidden and cannot be selected even if they are valid options.

To solve this issue, you can try resetting the filtered options whenever the value in the previous dropdown changes. You can do this by adding an action in the OnChange event of the previous dropdown that resets the filtered options in the dependent dropdown.

for example how you can reset the filtered options in a dropdown called "DependentDropdown" whenever the value in a previous dropdown called "ParentDropdown" changes:

Add an OnChange event to the "ParentDropdown"

In the OnChange event, add an action to set the value of the "DependentDropdown" to null or an empty string.

Add another action to refresh the "DependentDropdown" data source or list.

Save and publish the module.

With these changes, whenever the value in the "ParentDropdown" changes, the "DependentDropdown" value will be reset to null and the options will be refreshed, allowing you to select any option, including those that were previously filtered out

UserImage.jpg
jorginiho wijnhard

I tried this but i am still not able to select an option inside de dropdown 

2024-09-12 02-43-38
Deepsagar Dubey

Hi jorginiho,

Suppose you have 3 drop downs and which are dependent on previous dropdown.

So, we can assume we have 3 dropdown and 3 aggregates -


1. First Dropdown - First Aggregate - Fetch on Start.

2 Second Dropdown - Second Aggregate - Fetch on Demand - Pass selected option from first dropdown to make a filter in  Second Aggregate.

3 Third Dropdown - Third  Aggregate - Fetch on Demand - Pass selected option from second dropdown to make a filter in  Third  Aggregate.

I hope it'll solve your issue.

Thanks

Deep

2025-09-25 14-38-22
Lokesh Kumar Yadav

Hi  jorginiho wijnhard,

You have go on change action on the your drop down and refresh the aggregate whatever the value is not select  . 


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