WebListBox - enable multiple non sequential selections?

Hello all,

Typically when making multiple selections, the Ctrl key can be used. However with the WebListBox that does not work. On sequential selections can be made by holding the Shift key.

Is there a way to fix this or work around it?

Thanks,
Tim

On a Mac you can do the multiple non sequential selection with the Command key. Not sure the equivalent using Windows.

You could consider adding a “select” column with a check-box, allowing for ticking selections of any combination.

image

How do you add a checkbox to a weblistbox??
Tim

I am surprised that this does not work. In API1, it worked perfectly.

Could this be a bug in the framework??
Tim

I didn’t find an easy or obvious way to incorporate a true CheckBox, so I’m spoofing it and using a WebListBoxStyleRenderer to put an icon in the cell. If the user clicks the cell I just capture that event and re-render the cell with a checked (or unchecked) icon. I use the CellTagAt to store the state of the pseudo checkbox for evaluation later in the process.

If can_be_selected Then
  cellRenderer = New WebListBoxStyleRenderer(Self.listbox_records_for_review.style_normal_cell_emoji, Self.listbox_records_for_review.checked_icon)
  Self.listbox_records_for_review.CellTextAt(last_row,8) = cellRenderer
  Self.listbox_records_for_review.CellTagAt(last_row,8) = "CHECKED_SELECTED"
Else
  cellRenderer = New WebListBoxStyleRenderer(Self.listbox_records_for_review.style_normal_cell_emoji, Self.listbox_records_for_review.prohibited_icon)
  Self.listbox_records_for_review.CellTextAt(last_row,8) = cellRenderer
  Self.listbox_records_for_review.CellTagAt(last_row,8) = "CHECKED_DISABLED"
End If

I don’t think is a bug per se as Xojo’s WebListbox is based in Datatables.Net.
Datatables works the same (using Command key to do multiple selection), you can try the Winkey to see if that works for you:
DataTables example - Row selection (multiple rows)

If you create a feature request on Issues, I bet @Ricardo_Cruz will take a look to see if possible to bring back the use of Control key to do multiple-select.

The DataTables example works as expected.

I guess I’ll create a feature request
Tim

Thank you,
Tim

Interesting.
On my mac Datatables and Xojo work the same way (using the Command/Apple key).

If the WebListBox.RowSelectionType is set to WebListBox.RowSelectionTypes.Multiple it should allow you doing what you say.

Please open a new Issue, including the OS / Browser and versions, if this isn’t working.

Edit: I’ve seen you’ve already opened it (Issue #77550), thanks!

Don’t forget you can just enter a tick (I keep ‘:heavy_check_mark:’ aside as a Constant in case I ever want to change it) for use in a myWebListBox.CellTextAt(…, …) Method.

That parameter has been set in the IDE, not programmatically. I will try it programmatically too and advise.

Tim

Even when coded programatically, it still does not work correctly.
btw, tested on firefox

TIm