I've been banging my head against a brick wall with this for two days now. I have a ScriptUI with a dropdown list of 3D layers. The list needs to update when the user clicks the dropdown. So I capture the focus event with an onActivate, and rebuild the list as the user clicks. The problem is that rebuilding the list prevents the list from displaying, requiring a second click to show it. I'm guessing that rebuilding the list triggers an onChange event that automatically hides the list.
OK...it's not disastrous, but it's annoying.
I thought of forcing the dropdown list to show at the end of the onActivate handler, but can't find any command that does this. I've tried capturing the events further up the UI hierarchy, but without much luck. I've tried the show() method, faking UI or custom events with dispatch() and notify(), but nothing works. I'm clutching at straws now.
I'm wondering if there is even a scripting way to pop up a dropdown menu.
The best workaround I've got so far is updating the list on a mouseover which doesn't interfere with the click, but if one of the 3D layers in the list has been removed in the meantime, there's a nasty jump on rollover.
Can anyone help before I go insane?