"Blair, Matthew P." wrote:
> It appears that the default behavior of a popup list is to put
> the selected item text next to the popup trigger.
Right. The popSelect event gets passed unhandled to the system, which
then executes code to set the trigger text.
> When I write a handler for the popSelect event, however, the selected
> text does not appear next to the popup trigger; this makes sense to me
> since I have not explicitly coded that behavior in my handler.
Right again. Are you sure you are a newbie? :-)
> My question: does one typically write code to reproduce the behavior
> of the default handler, or does one typically call the default handler
> either before or after doing some processing on that event?
The easiest way is to return handled=false from your popSelect handler.
This makes the system do its default behavior like before. The system
doesn't know if you really have any handler or not, so the return value
is how it determines whether to do default handling.
There is one gotcha: if you set up the list to use a draw callback
function and to not contain an actual array of strings, then the default
trigger setting code will crash, because it always assumes the array of
string pointers is present. In this case, you do need to implement the
trigger setting logic yourself in your popSelect handler. (This isn't
your situation anyway, but file this hint away!)
-slj-