# Dropdown Table: Row Selection Problems

**URL:** <https://forum.inductiveautomation.com/t/dropdown-table-row-selection-problems/78149>\
**Category:** Ignition\
**Tags:** vision, ignition81\
**Created:** [August 21, 2023, 11:58am UTC](https://forum.inductiveautomation.com/t/dropdown-table-row-selection-problems/78149 "2023-08-21T11:58:54Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Craig\_Simpson](https://avatars.discourse-cdn.com/v4/letter/c/e56c9b/32.png) [@Craig\_Simpson](https://forum.inductiveautomation.com/u/Craig_Simpson)\
**Post date:** [August 21, 2023, 11:58am UTC](https://forum.inductiveautomation.com/t/dropdown-table-row-selection-problems/78149/1 "2023-08-21T11:58:54Z")

</div>

Hi, I have a problem returning the user selection of a row in a dropdown table.

I am passing production routing details to string array tags from our ERP system, as the length of each routing will vary every time. The arrays are then passed to a dropdown table as 6 columns, via script, which works perfectly.

 ![order_dropdown](https://us1.discourse-cdn.com/inductiveautomation/original/3X/2/3/23316b1e08b162babc0fa9e3599652be7ac8ae07.png)

The problem occurs now for me. I need the operator to select the Operation they are working on to proceed. If I double click on my selected row in the dropdown the dropdown table collapses but the view only shows the selected first column, not the entire row selection.

 ![dropdown_select](https://us1.discourse-cdn.com/inductiveautomation/original/3X/a/2/a2e0d5cc0e9e0fc68e5e3b7238cf4838efdde492.png)

I can return the row index via script, but the row string is only the first column (sequence 0000), as shown.

The first problem is how do I show the operator the entire row they selected, not just the first column?  
The second problem is even after selecting the appropriate row nothing is returned until the dropdown is clicked once more, even when placing the script in mouseReleased or properyChange events.

I can pull the row as a string by script, but it does not make a nice UI for the operator of they just see the "000000" after selection.  
Any help would be appreciated.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [August 21, 2023, 1:06pm UTC](https://forum.inductiveautomation.com/t/dropdown-table-row-selection-problems/78149/2 "2023-08-21T13:06:52Z")

</div>

Sounds like the dropdown component is the wrong component for the job. Consider using the selection mode on an read-only table component for something like this.

---

<div class="post-metadata">

**Author:** ![justinedwards.jle](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/justinedwards.jle/32/37854_2.png) [@justinedwards.jle](https://forum.inductiveautomation.com/u/justinedwards.jle)\
**Post date:** [August 23, 2023, 4:42am UTC](https://forum.inductiveautomation.com/t/dropdown-table-row-selection-problems/78149/3 "2023-08-23T04:42:56Z")

</div>

Playing around with this idea, I was able to accomplish this by overlaying a label with the fill background property set to `True`:  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/9/2/9279747953968e0f795f0efbae6d5710b2cb9d94.png)

**Here is the result:**

[https://us1.discourse-cdn.com/inductiveautomation/original/3X/3/6/3658f81d9bfd9887b92b785432d20054e6a6da2b.mp4](https://us1.discourse-cdn.com/inductiveautomation/original/3X/3/6/3658f81d9bfd9887b92b785432d20054e6a6da2b.mp4)

**Here is the script that drives the overlay text:**

```auto
# Written for the property change event handler of the dropdown component
# Qualify the event script using the property name of the selected index
if event.propertyName == 'selectedIndex':
	
	# get the overlay label component named 'OverlayLabel'
	overlayLabel = event.source.parent.getComponent('OverlayLabel')
	
	# get the dropdown component
	dropdown = event.source
	
	# define the selectedRow as the new selectedIndex
	# This requires columns zero or one to be unique
	selectedRow = event.newValue
	
	# if nothing is selected, apply the dropdown's noSelection text to the overlay's text
	if selectedRow == -1:
		overlayLabel.text = dropdown.noSelectionString
	
	# if something is selected, create a comma delimited string out of the selected row, and display it in the overlay label
	else:
		
		# Create a list of each element in the selected row ignoring the hidden value row (index zero)
		# Make sure each element is a string datatype for concatenation for the overlay label's text property
		rowData = [unicode(dropdown.data.getValueAt(selectedRow, column)) for column in range(1, dropdown.data.columnCount)]
		
		# Concatenate the selectedRow list elements with commas between each element
		displayText = ', '.join(rowData)
			
	# Set the comma delimited string to the overlay component's text property
	overlayLabel.text = displayText

```

Simply position the label component where it completely covers the text field of the dropdown component.

---

<div class="post-metadata">

**Author:** ![Craig\_Simpson](https://avatars.discourse-cdn.com/v4/letter/c/e56c9b/32.png) [@Craig\_Simpson](https://forum.inductiveautomation.com/u/Craig_Simpson)\
**Post date:** [September 14, 2023, 7:30am UTC](https://forum.inductiveautomation.com/t/dropdown-table-row-selection-problems/78149/4 "2023-09-14T07:30:11Z")

</div>

I like this, very nice. I may revert back to this at some point!

---

<div class="post-metadata">

**Author:** ![Craig\_Simpson](https://avatars.discourse-cdn.com/v4/letter/c/e56c9b/32.png) [@Craig\_Simpson](https://forum.inductiveautomation.com/u/Craig_Simpson)\
**Post date:** [September 14, 2023, 7:31am UTC](https://forum.inductiveautomation.com/t/dropdown-table-row-selection-problems/78149/5 "2023-09-14T07:31:19Z")

</div>

Thank you. The functionality certainly seems to work better, although not what I had in mind visually. Small cost to make things easier though. Appreciate your reply.
