Open a Perspective popup when a user chooses to create a new dropdown entry

I have a dropdown component with custom entry selected. If the user creates a custom entry I want to immediately open a popup window. Is there a natural way to accomplish this in Perspective?


I think I could accomplish this by comparing the value property against the options property and determining this is a new entry but I wanted to confirm I wasn't missing a more obvious path.

Thanks for an input.

I do think this is the best way, but keep in mind that the Popup won't be opened until after the new value has been applied; if you're looking to require confirmation before creating the new option, you'd be better served having something akin to a + icon next to the Dropdown where clicking the icon opens a Popup which acts as a confirmation while (temporarily) injecting the new option into the options of the Dropdown.

I think I can make it work in my case. There is another button where they confirm the entry of the entire page. This dropdown popup is basically to update some database table entries to make sure the final submit button completes successfully.

Thanks for the verification. I'll post my code to do it shortly.

Working code:

ds = self.props.options
for row in range(ds.getRowCount()):
	TaskTemplateName = ds.getValueAt(row, 'TaskTemplateName')
	if TaskTemplateName == currentValue.value:
		# Entry already exists
		# Open popup so user can add new entry to system.
		system.perspective.openPopup('xyz', 'facility/addTask/newTask', params = {'TaskTemplateName' : currentValue.value}, modal = True)

I put this code in a Change Script on the dropdown value property. I read in the options dataset and compare my currentValue against the dataset values (dataset has a column called TaskTemplateName). If the entry isn't found in the dataset I pass a parameter called TaskTemplateName with the currentValue into the popup where the user can create a new TaskTemplate.