Refreshing Custom Component in List View


I've built a custom component that I've embedded into a list view. Theoretically, I should be able to refresh all of the instances of this custom component by passing a list of ints representing each instance in my list view. However, when I try to do this, only the first instance of the custom component reloads.

See attached screenshots regarding the guidance offered by the app builder.

Thanks for your help with this!


Another data point - from the debug console, if I manually call my_custom_component[some_idx].reload(), it appears that only the first one is ever reloading...

Hi @Sydney_Runkle I'm seeing the same issue :disappointed: I will flag it to our team & will let you know if I get any updates or find any workarounds!

1 Like

@Tess any updates on when this might be fixed? Do you know of any workarounds that I could use in the meantime?

Hi @Sydney_Runkle! I don't have a timeline for a fix yet :disappointed: I did notice that the updateModel method works for custom components in list views - any chance you could work around this by making some update to the model instead of simply reloading? :crossed_fingers:

Hi @Tess, thanks for your response. Each of my models has data that depends on the index i of the list item that the custom component is nested in. How can I access that from the call to updateModel?

@Tess, in other words, how do I get the index of the custom component that I'm trying to update the model of?

Hi @Sydney_Runkle

Where is the trigger happening? If it's from the listView, you can do something like this:

If you need i somewhere in the component logic, you could pass it to the model:

Hi @Tess

The trigger to refresh all of the custom components within the list view is happening external to the list view (whenever a dropdown select changes). Even if I do update all of the models based on some trigger, that doesn't cause them to refresh though, right?

I'm already using {{i}} within the model definition, as the i variable is accessible within the scope of the list view as you mentioned :smile:.

Unfortunately it seems like bc the trigger to refresh all of the custom components is outside of the list view, there's no good way to access the index of each component (unless I'm missing something).

I'm guessing this does have to be solved by fixing the refresh bug - do you have any other thoughts for temporary solutions?

@Tess any updates on this? Thanks!

We haven't found any workarounds yet :disappointed: I bumped the request internally though! Will post here if I get any updates!

1 Like