How to use updateContent() for reloadind a TableListBox using XML file?


I am saving data to an XML file and I would like to refresh the TableListBox with the new data added in the XML file.

I tried to use updateContent() in the timerCallback() like this

        juce::XmlElement* newElement = dataList->createNewChildElement("ITEM");
        newElement->setAttribute("ID", numRows + 1);
        newElement->setAttribute("Name", "");

        const juce::XmlElement::TextFormat& format = {};
        if (tableFile.exists()) {
            tutorialData->writeTo(tableFile, format);


The data is written correctly in the XML file, but I have to close the application and reload it to see the changes.

I saw in the documentation of updatContent()

This must only be called from the main message thread.

I don’t know what that means exactly

Can I use updatContent() in the timerCallback?
What am I doing wrong so that the contents of the table are not updated ?

Thank you :slight_smile: