Specify default option in showSelectDialog?

Is it possible to specify a default option (which option is selected) in the showSelectDialog method of the dialogs plugin? I have a long list of things, and I would like to default to the one the user selected the last time the dialog was displayed.

If this functionality doesn’t exist, could I convince you to add it? :slight_smile:

The progress plugin (sorry about the name but it comes from a different direction) has alternative dialogs to those of Servoy Servoy Components – Plugins, Beans, Web Components, Angular Services & Servoy Developer Consulting.

I can quite easily add an opion to the select dialog in the end that is the default value.

Please let me know…

Code to put the last selection as the default followed by a line and then the original list:

var defaultList = new Array("Value 1", "Value 2", "Value 3")

if (globals.selected) {
	defaultList.unshift(globals.selected, "-")
}

//show select,returns nothing when canceled 
var selectedValue = plugins.dialogs.showSelectDialog('Select','please select a name', defaultList);

globals.selected = selectedValue

david:
Code to put the last selection as the default followed by a line and then the original list:

Hi David,
I know it was years ago you posted this, but needed solution today, found this, works great, THANKS! :D

Rafi

Very cool :)

It seems that showSelectDialog no longer shows the first option from the list as default option with NG in my case…
It’s just a blank, but clicking it still shows the list of options. Could this be due to NG or is it an option somewhere?