Multiselect dropdown in Vision

Do we have multi selection facility in vision dropdown component like we have in perspective?
Sorry! off topic.

No. Vision’s dropdowns are ultimately Java Swing JComboBoxes ‘under the hood’, and the entire component model assumes single selection.

Can you please suggest what we can use for multi selection dropdown

It seems like it would be relatively easy to give a jtable the appearance of a dropdown with all of the same functionality plus multiselection.

really don't know what it is. I haven't tried Jtable, need to know JAVA also for Ignition.
Is there any option

Unfortunately, I'm not where I can draw anything up right now, but if nobody comes up with a better solution, I'll do it later in the day. Both the dropdown, and the basic table use a dataset to store data, so the table could easily hold the same [label, value] data as a dropdown. Position a small square button next to a text field with the same arrow icons, and script the visibility of the table. This would probably be best if it were designed as a template.

It's possible somebody has already done something like this. Have you checked the ignition exchange?

1 Like

I found the time to cobble a template example together. Here is a side by side comparison with the multiSelect dropdown on the left and the standard dropdown on the right:

The selected indexes, values, and labels are stored in the template's properties as datasets:
image
image

Below is the template itself. Feel free to download it, import it, and continue development on it until it suits your needs:
multiSelectButton.zip (10.1 KB)

4 Likes

It's been a while, but there is now a legit multiselect dropdown available for download at the exchange:

Multiselect Dropdown Exchange Resource: Version 1.0

Multiple selections can be made in the normal way with the ctrl or shift keys:
ctrl Selection
Shift Selection

It is also possible to arrow up or down and use the enter key to select or deselect items:
Enter Selection

The dropdown also filters possible selections as the user types making it easy to locate specific selections in long lists:
Search Capability

The dropdown also features a table mode:
Table Mode

Here are the results:
Result

8 Likes

Hey, ive installed the new package from gateway, was wondering where the new dropdown appears? I can't seem to find it.

If you mean you've downloaded and imported the exchange resource, then it will be in the project browser under Vision Templates.

Hi, thank you so much for that, another question, I am trying to use the new function Multi-Select dropdown to display different values in my power table based on the selections in the dropdown. The problem is I cannot directly access a dataset object (selectedLabels) in my Power table SQL query. How can i do this?

Hi, it's really good to use, thanks. As you know for a normal dropdown we can set -1 to selected value to clear selection, how can I do to reset the Multi Select Dropdown?

The multiselect dropdown equivalent of selectedValue is selectedValues, which is a list dataset datatype instead of an integer datatype. Simply provide selectedValues with an empty list to clear the selection.

Example:

# Clear current selections using a component in the same container as the dropdown
event.source.parent.getComponent('MultiSelectDropdown').selectedValues = []

Any time the selectedData, selectedIndexes, selectedLabels, selectedStringValues, or selectedValues properties are written to, the other properties will automatically update with the data that corresponds to the property that was changed, so writing a blank list to any of these properties will effectively clear the selections.

Thank you, it works. :100:

1 Like