I have a listbox when i choose more than one element the first clicked element is unselected unless i press ctrl although Selection mode attribute is set to multiple

how to make a listbox multiple select without clicking ctrl before selecting?

Hi Muhamed,

That is the standard behavior of a list box in multi-select mode. 

  • Single click = deselect all previous and select clicked item
  • Ctrl+click = Select clicked item and add to list of selected item
  • Shift+click = Select clicked item and all items between the selected item and previously selected item

If you want to ensure more then 1 item is selected you will have to check the list content.

The Listbox in OutSystems is just  standard HTML5 Select element. As such the behavior is consistent with what other web  application most likely provide when using a multi select list box.

Without custom javascript code you cannot achieve what you want, and even with Javascript I do not think it is easy. Here is a post that might help you:

https://stackoverflow.com/questions/8641729/how-to-avoid-the-need-for-ctrl-click-in-a-multi-select-box-using-javascript

Regards,

Daniel

Muhamed Akl wrote:

I have a listbox when i choose more than one element the first clicked element is unselected unless i press ctrl although Selection mode attribute is set to multiple

how to make a listbox multiple select without clicking ctrl before selecting?

Hi Muhamed,

You can check the outcome here.

https://yogesh-satpute.outsystemscloud.com/MulitpleSelectListBox/Entry1.aspx?_ts=637183305437494682


Please let me know your looking for same.


Hope this will resolve your problem.

Good luck!

Regards,

Yogesh Satpute


Hi Muhammed,


There is a select2 widget available in the webpatterns that can be used  with the list box just by passing the ID of the listbox.

Use it to convert your listbox into a multi select with easy selection and unselection from within the list.