Custom component in a repeating panel not populating data

I have built a custom component that has several parameters. When I use the component, say in a column panel, and supply the values for the parameters, everything works as expected. However, no data is displayed when I use the same component in the itemTemplate of a repeating panel.

I have included a small clone that exemplifies the issue. Form1 has the custom component where the properties are set directly to static values. Directly under that component is a repeating panel with the itemTemplate using the same component. This time, I have checked the link symbol and set all of the properties to self.item[‘key’], where the key is the index for that specific property.

I am printing self.item in the init method of the itemTemplate, which shows the correct data. However, inside the custom component, none of the parameters are set.

I have searched the forum for any pointers and have come up empty. Is there something I am missing? Is this a defect, a knowledge gap?

Any suggestions are greatly appreciated.

That’s because you weren’t setting the properties of the custom component from the item and you need property decorators for each of the custom props to set apply them if they are set after initialization.

1 Like

WOW thank you very much. I see what you have done but why if you need setter/getters did the non repeating panel example work where I set

    self.header_1.text = self.header
    self.text_1.text = self.text
    self.image_1.source = self.image
    self.link_1.url = self.url
    self.link_1.visible = self.visible

in the init method of the custom component? Is there some documentation I can read about this? I feel like I have knowledge gap here and I would like to learn.

Again, many thanks.

Because you were setting those values when initializing the component for the first time in the __init__ function. The repeating panel example initializes the custom component first and then sets the properties later with the item.

Here’s the documentation for custom props that includes the info on property decorators:

1 Like

Thank you Duncan! I appreciate you taking the time to answer my question.

1 Like