Hello all,
The disabledOptions configuration works correctly, but the pre-selected values (StartingSelection) do not seem to work, as all options are displayed unchecked.
Is there any workaround to make this work?
Thanks in advance
Hello @Paulo Torres
AFAIK, that's not a supported use case.
If you can find a way to do that on a Codepen using the Virtual Select library, please let me know, but even from a UX perspective, having selected options that are disabled is a bit strange since conceptually they have an opposite meaning.
Cheers,GM
@Paulo Torres : This is what I have done.
Value for Dropdown Search :
StartingSelection :
disabledOptions
Result :
For me it seems works. Can you check if the Value in 'StartingSelection' matches in the values OptionLists.
Hello,
What is the version of your OutsystemsUI?
Thanks
The one on my environment is 2.24.0
Your test case is different. If you set the disabled ID to the same value as StartingSelection, it doesn't work.
This appears to be a bug.
As I understand it, when we say disabledOptions, those items should not be selected irrespective of StartingSelection. May be this is an intended functionality.
Maybe! Gonçalo will helps :)
@Paulo Torres : "However, if at least one ID exists in both lists, the dropdown does not display any pre-selected values." - This statement is incorrect. In the shared OML, modify the GetStartingSelection Screen aggregate to include Id 5 ( or Sample_Color.Id = IntegerToIdentifier(5) ) and Set the Max Records to 3 and you can see Blue is preselected.
Hi @Paulo Torres ,
The starting selection only works if the values passed match exactly with the values in the options list. If the values are not aligned with the source list( for example due to different ID's, types, or the list being loaded later), the option will appear unchecked.
A common workaround is set to the selected values after the list is loaded. Once the options list is populated , loop through the list and mark the corresponding items as selected based on your Starting Selection values.
Could you please share a sample oml where we could check your exact use case?That would help the community give more accurate help.
Sure @Gonçalo Martins. I was waiting for you :)
Summary: When the IDs in StartingSelection and DisabledOption are different, the component works correctly. However, if at least one ID exists in both lists, the dropdown does not display any pre-selected values.
Hello @Paulo Torres,
After testing it, I found that the issue is in your logic since you're setting the same records as disabled and starting values, which is not a valid use case:
If you have those values, it works:
Check your sample fixed.
Hope it helps!
Hello @Gonçalo Martins ,
Actually, it’s not an issue. It was done on purpose. In some cases I may want to disable all options, even if they are selected, because when the dropdown is disabled and multiple options are selected, we can’t clearly see the selected values, it appears something like "5 options selected".
With the Dropdown component, is there any way to handle this scenario?
Thanks for your attention.