Copy link to clipboard
Copied
Looking for a built-in way to let the user select an item in a list, but to return a corresponding key (that should not be visible to the user), I was pleased to see that the javascript way of automatically expanding objects with new properties came in handy:
myDlg.Panel1.DropDownList1.ListItem3 = myDlg.Panel1.DropDownList1.add('item','The text to show');
myDlg.Panel1.DropDownList1.ListItem1.listKey = 'my secret code'; // listKey is not a default property
The list item is now expanded with a new property called listKey, and the "key" of the selected item can be found in this way:
myDlg.Panel1.DropDownList1.items[marketDlg.Panel1.DropDownList1.selection.index].listKey
I hope you get the idea, and that this might be helpful for someone looking for the same thing.
Andreas
Copy link to clipboard
Copied
This was accidentally marked as question (closing).
Find more inspiration, events, and resources on the new Adobe Community
Explore Now