Automatically update an UIList I've created an own UIList for an addon. It's just used to display some properties of Action (as that one doesn't have a properties panel in the Action Editor), so it must get populated with actions and not with user input.

It actually must be updated manually, with a button I added below it. Althought this already works, I think it's not nice, so I was wondering if there was any way to update the list automatically.

I tried to override the draw method and override it there, but then the List (and the panel in general) isn't displayed at all.

def draw(self, context):
        # LIST UPDATE
        bpy.types.UIList.draw(self, context)


Here's my UIList implementation:

class MyUIList(bpy.types.UIList): 
    def draw_item(self, context, layout, data, item, icon, active_data, active_propname, index):

        custom_icon = 'OBJECT_DATAMODE'

        if self.layout_type in {'DEFAULT', 'COMPACT'}:
            layout.label(bpy.data.actions[item.Index].name, icon = custom_icon)

        elif self.layout_type in {'GRID'}:
            layout.alignment = 'CENTER'
            layout.label("", icon = custom_icon)


Thanks in advance!
Thanks to @batFINGER and @poor comments, I've been able to do this, so I'm gonna post it here for if someone has the same problem.

The trick had to be done in the panel draw method, when drawing the UIList:

row.template_list("MyList", "", bpy.data, "actions", context.scene, "myListIndex")


The third and fourth arguments are the place from were the list items will be get. I was using a custom list here (that just pointed to an action), so that was redundant.
The fifth and sixth arguments are where the selected item index is stored, which in my case is in the Scene properties.

Thanks for your help!