juce::ListBox and ListBoxModel broken?

Hello. I’m trying to create a ListBox that updates dynamically. The length of it and its contents will alter based on filters that are selected in other lists. For some reason, I can fill these listboxes when they are initialised, but beyond this they will not update. When I use “updateContents()” and follow it with “repaint()” or “repaintRow()”, the rows are not appearing.

Here is the code that I am using. I am trying to update the listboxes through the “setDataList” and “addData” list which either replace the data that the list should display or append data to it respectively. For whatever reason, the “paintListBoxItems” function is never called after the listBox is first constructed.

HEADER FILE

#include <JuceHeader.h>

//==============================================================================
/*
*/
class GFJuce_UPB_List  : public juce::ListBox, public juce::ListBoxModel
{
public:
    GFJuce_UPB_List();
    ~GFJuce_UPB_List() override;        
    
    // ListBoxModel
    int getNumRows() override;
    void paintListBoxItem(int rowNumber, juce::Graphics &g, int width, int height, bool rowIsSelected) override;
    
    // Getters and Setters
    virtual void setDataList(juce::Array<juce::String> array);
    virtual void addData(const juce::String data);
    virtual void clearData() { dataList.clear();}

protected:
    JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (GFJuce_UPB_List)
    
    juce::Array<juce::String> dataList;   // List of data to display in list    
};

CPP FILE

#include <JuceHeader.h>
#include "GFJuce_UPB_List.h"

//==============================================================================
GFJuce_UPB_List::GFJuce_UPB_List()
{
    setModel(this);
}

GFJuce_UPB_List::~GFJuce_UPB_List()
{
    
}

int GFJuce_UPB_List::getNumRows()
{
    return dataList.size();
}

void GFJuce_UPB_List::paintListBoxItem(int rowNumber, juce::Graphics &g, int width, int height, bool rowIsSelected)
{
    if (rowIsSelected)
        g.fillAll(juce::Colours::lightslategrey);
    
    juce::String data = dataList[rowNumber];
    g.setColour(juce::Colours::black);
    g.drawText(data, 4, 0, width - 4, height, juce::Justification::left);
}

void GFJuce_UPB_List::setDataList(juce::Array<juce::String> array)
{
    dataList = array;
    updateContent();
    repaint();
}

void GFJuce_UPB_List::addData(const juce::String data)
{
    dataList.add(data);
    updateContent();
    repaint();
}

Thank you in advance for your time!

perhaps

    void paintCell (juce::Graphics& g, int rowNumber, int columnId, int width, int height, bool rowIsSelected) override;
    
    juce::Component* refreshComponentForCell (int rowNumber, int columnId, bool /*isRowSelected*/,
                                              juce::Component* existingComponentToUpdate) override;