I'm trying to make it so that the key selected in the top dropdown automatically populates the input box below:
The code is really simple, triggered by the only event available for dropdowns ("onSelect"):
session.findById("wnd/usr/ctxtYPCN-PCTYPE").text = session.findById("wnd/usr/subPersonas_149796688890599/cmbPersonas_14979739727949").key;
However, the onSelect event seems to fire before the dropdown's value updates. For example, when I make my first selection, nothing happens (because it's pulling the placeholder value):
... and then when I make more selections, the script pulls the previous key:
Is there a way to get onSelect to behave as you'd expect? If not, what is the onSelect event supposed to actually be used for? Should this script be attached to onAfterRefresh instead?