Custom component's `form_show` is not triggered

I am trying to recreate the ProgressBar custom component that @campopianoa graciously shared last year: Progress bar custom component.

I think I have done the entire setup, but the form_show method of Progress Bar never gets fired. I have tried to use the Progress Bar individually on a page, like in his clone app, as well as part of a bigger component and in a repeating panel. Consequently, no progress bars show up, individually or in a repeating panel.

I also tried recreating the component in a custom theme app and material design with the same results, so I don’t think it has anything to do with the theme.

I am fairly new to custom components, so it could be something basic. Could something point out what I am missing?

Clone link:
https://anvil.works/build#clone:6V5I6F4BJRSKAZRC=5YCZQBQXBSEC5PRLWTSLSB32

I’ve not looked at your code, so this is a guess but…

Have you set the form’s show event to be your form_show method in its properties? I often forget to do that.

You might also like to know that the Anvil Extras library has two progress bar components you could use.

2 Likes

@owen.campbell Apologies for the late reply. Life has been a bit hectic lately.

Thank you so much! Yes, that was exactly it. I had to set up the form_show method at the component level.

And a big thanks for pointing me to the Anvil Extras library. That deserves a mention in the standard Anvil docs.

1 Like