[Multiple Selection Dropdown Widget (Reactive And Mobile)] Regarding Multi select dropdown

I have used the multi-select drop down box from the Forge. It is working fine but unable to display the multiple selected items properly.

If I select all then getting below output:


But unselected items not going from the list.



OutSystems logic:

 Need help on how to get the correct selected items.



Hi Chris,


The issue has been resolved. I have modified the data selection logic and set Return_SelectedItemsOnly = True as per your suggestion. The modified logic is



The code in assignment is :

Selected Items:

 If( VarCategories = "", 
            Substr(MenuItems.Current.Meta_Text1, 0, Index(MenuItems.Current.Meta_Text1,"-")),
            VarCategories + "," + Substr(MenuItems.Current.Meta_Text1, 0, Index(MenuItems.Current.Meta_Text1,"-"))
      )

De-selected Items

If( MenuItems.Current.IsSelected = False, 
    If( VarCategories <> "", 
            Replace(VarCategories, "," + MenuItems.Current.Meta_Text1, "") ,
            ""
      ),
      ""  
)


In my use case I need to extract first few character before '-' so I have used the "substring" function, but it may not valid for all use cases. 




Hi Avijit,

Great write up!

I’m really glad you managed to solve this!

Just be aware that the code branch that acts when an item is not selected will only work if you return the entire list.

For example, when Return_SelectedItemsOnly=True, you will only get (returned to you) items in the list that have been selected by the user. If the user hasn’t selected anything, the returned list will be empty. You won’t get unselected items.

Hope this helps,

Best Regards,

Chris.

Hi Avijit,

At first glance this looks like a CSS problem. I’d like to help you solve this. Are you able to share an .oml file with me (either here in the public forum or email me privately).

Best Regards,

Chris

Hi Chris,


Please find the attached .oml file for your reference. 


Thanks,

Avijit

CognitiveSearch.oml

Thanks, I’ll take a look and get back to you soon!

Hi Avijit,


In your original post you included an image with text under the dropdown widgets.

Is that text the returned list from the widget?


If so, it might not be CSS at all. It could be the returned list that is the problem.


You can control what the widget returns using the parameter:

Return_SelectedItemsOnly = True

only items that user has selected from the dropdown menu are returned.

Return_SelectedItemsOnly = False

the entire dropdown menu is returned - regardless of what the user has selected.


Let me know if this helps,

Best Regards,

Chris.

Hi Chris,


The issue has been resolved. I have modified the data selection logic and set Return_SelectedItemsOnly = True as per your suggestion. The modified logic is



The code in assignment is :

Selected Items:

 If( VarCategories = "", 
            Substr(MenuItems.Current.Meta_Text1, 0, Index(MenuItems.Current.Meta_Text1,"-")),
            VarCategories + "," + Substr(MenuItems.Current.Meta_Text1, 0, Index(MenuItems.Current.Meta_Text1,"-"))
      )

De-selected Items

If( MenuItems.Current.IsSelected = False, 
    If( VarCategories <> "", 
            Replace(VarCategories, "," + MenuItems.Current.Meta_Text1, "") ,
            ""
      ),
      ""  
)


In my use case I need to extract first few character before '-' so I have used the "substring" function, but it may not valid for all use cases. 




Hi Avijit,

Great write up!

I’m really glad you managed to solve this!

Just be aware that the code branch that acts when an item is not selected will only work if you return the entire list.

For example, when Return_SelectedItemsOnly=True, you will only get (returned to you) items in the list that have been selected by the user. If the user hasn’t selected anything, the returned list will be empty. You won’t get unselected items.

Hope this helps,

Best Regards,

Chris.

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