Answered: MVC: Correct listening to dockedItem events?

Hello,
I've set up a new application with the MVC pattern and want to listen to the events of the dockedItems of window A, but in don't know how to resolve the correct references to the item in the controller.

The problem now is when i press the button there's no output on the console and it seems that the event isn't handled by the controller. On the other hand the listening to the selection event of the windowA works fine and the console writes it's message.
How do i listen to the events of the dockedItems?

I think you'd just need to construct a suitable component query. Docked items are similar to normal items in that regard. e.g.

Code:

'windowa toolbar button'

This has obvious issues if you have multiple buttons in toolbars but it should be fine in the example you gave. If you did have multiple buttons you'd need to come up with something a little different, see the component query docs for pointers.

I think you'd just need to construct a suitable component query. Docked items are similar to normal items in that regard. e.g.

Code:

'windowa toolbar button'

This has obvious issues if you have multiple buttons in toolbars but it should be fine in the example you gave. If you did have multiple buttons you'd need to come up with something a little different, see the component query docs for pointers.