UI NonResponsive

Hi, had a preexisting dropdown that I altered to a multiselect dropdown and added a transform script to the option. After making that change I'm suddenly getting a Nonresponsive UI error and the designer pretty much needs to be rebooted.

Can't really find any documentation on this error and I have no idea how to make sense of the json provided by the error, one forum here leads me to believe its an issue with params (possible bidirectional params) but if someone is able to give some insight I'd really appreciate it. I added the transform script and the params the dropdown is bound to below. Let me know if different information is of use.

Thanks!

def transform(self, value, quality, timestamp):
	
	selected = self.props.value
	value = system.dataset.toPyDataSet(value)
	
	if selected is not None and 0 in selected:
	    selected = [i for i in selected if i == 0]
	    self.props.value = selected
	    
	    value = system.dataset.toDataSet(list(value.columnNames), [value[0]])
	
	return value

image

NonResponsiveEdt-2023-11-08_165452.json (46.6 KB)

Sounds like you made an infinite loop. Don't change the dropdown's selected value from inside of the transform of the options list. Just transform the options, nothing else.

Based on what your transform's code and me taking a guess, are you using the same dataset to store the user's selection and build the options list? If so, what is likely happening is that your transform is triggering a change script on the selection value, which in turn causes whatever provides the selection data to 'change' its value, which causes your transform to run again which causes the selection value to change and so on and so forth.

If you need to change the format of the selection value, do it in a custom property on the dropdown and then bind the selection value to that custom property. That will help to avoid any infinite loops of trying to adjust the value in place.

4 Likes

Ohhhhh, yea, basically my '0' selection is essentially like selecting all so I was wanting to remove all other options except that one from both the value and options. I'll find another way to do it -

Thank you!