Listbox Item Selected Event

Is there a list box event for item selection?

What kind of listbox - a Calc dropdown, or in a dialog perhaps? Please post any example code you have so far, and any links you have found by searching for an answer. Look at the API docs: service UnoControlListBox, and try an introspection tool such as XrayTool. See guidelines for asking.

I would like to know the answer to this if it’s a list box in a form control in Writer for use with Base. Obviously, the Events list for the list box control doesn’t contain one called “Selection made” or anything like that, and my first guess would be to use the “Item status changed”, but if the user starts typing to find what they want, that event occurs with every keystroke. Is there an event for a list box that will occur when and only when a selection is made?

And how can you determine whether a change in the selection of an element is intermediate or final?

I’m not really concerned with whether it is intermediate or final, so I guess I’m just assuming all selections should be treated as final.

I’m asking for two scenarios:

  • A cascading listbox, where listbox 1 is tied to a field in cache table, and listbox 2 has for it’s listsource a query with a where clause referencing that cache field. For this to work, I need to refresh the form of listbox2 whenever a selection is made in listbox 1. Launching for intermediate selections would only cause an extra refresh–no problem.
  • A navagation listbox in its own form, where the user selects the value of a certain field from the record they want to go to, and a macro makes the main form jump to that record. For this to work, the macro must be launched whenever the selection is made. An intermediate selection would only cause an unnecessary jump–again, no problem.

You are correctly handling the event named "Item status changed” in the event list. The parameter type of your handler is ItemEvent.