Dashboard form with embedded pages

Hi @david.wylie and @meredydd

Thanks for these helpful tips. I have a question about what is most “Anvil-ic” (best practice) about displaying a new page in an app. So far I have used three methods for this:

  1. open_page('my_new_page')

  2. self.content_panel.clear()
    self.content_panel.add_component(my_new_page())

  3. get_open_form().content_panel.clear()
    get_open_form().content_panel.add_component(new_page)

I can see that method 3 works well if you are sitting on a component that lives inside a repeating panel for example (or some other nested situation), and you want to reach back and clear the parent. But why not use something like:

self.parent.parent.content_panel.clear() # with more or less parents...

(I must admit that I have not always gotten that approach to work; only sometimes)

Could you help me to understand when to use each of these and what is preferred?

Sincerely,
Al