Pages or Containers

In a web app should one have multiple pages or a single page with multiple containers?

This was discussed here: four years ago. Anyone have any additional thoughts?

Depends what you want to do. In my web app, I have containers that are used to dynamically create groups of controls. Depending how many devices my web app controls, I could have one to 10, 20, 50 or any number of containers dynamically created. And I have different container classes for mobile or desktop browsers because there are things that work in desktop browsers that don’t in mobile. These container classes both contain the same class interface methods. So I can have multiple users all in different browsers and when one user updates one device, that change is reflected on all the user’s screens.

Now, if you want to show different content on the entire page, then create a new page. Don’t just change out the container. A new page may need new methods, properties, etc.

Single pages is easier, IMO. But I’ve done it both ways. It really depends on what you plan on doing.

BEWARE a mistake I made.
I found that the more complex a Page is with containers that are static and NOT dynamically created and destroyed - makes your app slow to start up. It then appears to users unresponsive.

I had an app that I populated a lot of containers and made them visible when needed. i.e. Did NOT CREATE and populate when I needed them. That was a mistake. Slowed my start up process and made the app seem unresponsive.

Yeah, I’ve been bitten by something similar. For us it wasn’t containers but static Web Dialogs. They are included in the WebPage they are hosted on. The way around it is to dynamic WebDialogs.

I only do containers for everything and almost always dynamically embed them. Then I subclass the WebPage and WebDialogs so that the have a container property that they embed in their Shown event. I always found I regretted my decision when I didn’t make something a container and had to convert everything over. IMHO containers are the most flexible and powerful control in Xojo, all you do is constrain yourself once you explicitly make it a WebDialog or a WebPage.

Before, all of my web screen uses container. Got hard time to maintain, first time loading is so slow and there is no BACK button.
Until I found a free sample xojo app where it uses pages on each web screen (retaining the session). BACK button can be simulated and the refresh of screen becomes fast.

I choose WEBPAGE now for simplicity.