Detect row selection from other component

Hello,

I’m back to Juce after a while and it seems I’m a bit rusty.

I have my main component which has a TableListBoxModel with a list of Devices.
When the user selects one device I want to show all the extra information below the table using other component, let’s call it DisplayInfo.

How can I detect from my MainComponent that the TableListBoxModel row selection has changed so I can update my DisplayInfo object?

Thanks!

Hi @loca,

TableListBoxModel has a cellClicked() method that you can override to receive a callback when you click on one of the cells in the table. If you pass a reference to your main component class to your TableListBoxModel via its constructor you can then call a method in your main component to display your DisplayInfo component in this callback.

Hope this helps,
Ed

Hi Ed,

Thanks for the hint. I used getParentComponent instead :slight_smile:

Ana