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.
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
You have an example on how to implement it on this video:
How to build cascading or linked dropdowns in OutSystems?
Thank you i will take a look at this!
Hi @jorginiho wijnhard
Are your refreshing the aggregate on DropdownOnChange action ?Maybe the issue is related aggregate refresh.Regards
Krishnanand Pathak
Yes i am already refreshing the aggregates on change but the values inside the dropdown stay unclickable
I Just tried this but sadly no results it stays the same for me
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").ThanksGitansh Anand
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?
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.ThanksGitansh Anand
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
I tried this but i am still not able to select an option inside de dropdown
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
Hi jorginiho wijnhard,
You have go on change action on the your drop down and refresh the aggregate whatever the value is not select .