In a ScriptUI Window different components are usually registered for Events, and fire their own Handlers. You can build some interconnection, so for instance a Button's 'click' handler triggers a change in a ListBox, which in turn reacts to its own 'onChange' Event. It's quite easy to decouple this interaction, provided that you set up your code properly.
Posts Tagged - ScriptUI
In your code you may need to run a ScriptUI component's callback, or simulate a user interaction, maybe as a part of a subroutine. There are few ways to do this, with slight differences in the behavior: directly, using call(), notify() or dispatchEvent() - I've set up a commented demo Dialog that shows them all.
ScriptUI Windows can be tricky in Photoshop, especially if you want to create a non-modal, persistent and idle palette. While a couple of workarounds are possible, as I've shown in a previous post, there's a better alternative involving BridgeTalk.
Photoshop implementation of ScriptUI windows of type 'dialog' and 'palette'