How can i build a MasterPage effect.

I’m trying to get a WebPage act as the super of all other Webapges i have.

Basicly i’m looking for a MasterPage, that will edited in the IDE, add some controls and have this controls to be seen on any other WebPage i have.
To see a toolbar and a footer on every WebPage.
Can this be done?

Controls on a webpage are not inheritable, only constants, properties, events and methods.

You can put the toolbar on a container control, then include that container on every page. Then you only have to edit the toolbar in one place. Same for footer. Another method is instead of using different pages, make the content area a container and swap in different containers to change the “page”.

[quote=48180:@Jay Madren]Controls on a webpage are not inheritable, only constants, properties, events and methods.

You can put the toolbar on a container control, then include that container on every page. Then you only have to edit the toolbar in one place. Same for footer. Another method is instead of using different pages, make the content area a container and swap in different containers to change the “page”.[/quote]

if you say so, why does it work but only don’t show in the IDE?

UI has never been inheritable. The IDE is trying to be overly helpful. It’s a bug that you don’t get an error message when you try it.

It seems that i can make a WebPage1 with a Super of WebPageMaster wich has a toolbar on it to show the toolbar also on WebPage1.
The fact is, the IDE doesn’t show this, it doesn’t show anything other than the default blank page.

Well i guess, it’s working cause it shouldn’t ?
For the showing of the (visible) objects in the IDE that’s something?

I mean, when i do this

WebPage -> WebPageMaster -> WebPage1 & WebPage1 (have super WebPageMaster)

They show ALL controls (and are working) that’s on WebPageMaster.
I wanted to ask if this is normal, a good way and/or actually how it should be.

No, it shouldn’t work at all. It will eventually be “fixed”, so don’t count on it.

Ok i see now.
I’d make a feedback request for a WebPageMaster or something.

I think this might prove usefull as most web apps will have some controls on all pages.

Make a container (or containers) for the common controls. Put that container on each page. I think you’ll find that it separates common code well enough.

the part “put that container on each page” is just the part i DONT want.

I guess I’d have to see the visual superclass idea implemented. I can’t imagine how it wouldn’t be confusing, in that somehow, the editor has to distinguish class/window/page controls from super-class/window/page controls. But I don’t have a very good imagination either.

It’s very simple to understand.

The super will give pre defined controls (just like an ordinary WebPage would have) to any WebPage. Meaning that one could just act af if it was the background but no events or so would be given to the WebPage that makes use of the MasterPage. To interact with the MasterPage you should be able to just call it by it’s name.

Fair enough. I’d still have to see it to be convinced. But that doesn’t mean it’s a bad idea.

I din’t hear you say it was a bad idea.

You can probably see it in many web design programs like WYSIWYG Web Builder.

@Derk Jochems - The fact that it works is a bug. In the same way that you cannot inherit control instances on a Window in a Desktop project, you shouldn’t be able to do it here. There are a lot of things behind the scenes that I can think of which will have an undefined behavior if you do this.

As was suggested, I’d use WebContainers for the things you want on every page.

[quote=48331:@Greg O’Lone]@Derk Jochems - The fact that it works is a bug. In the same way that you cannot inherit control instances on a Window in a Desktop project, you shouldn’t be able to do it here. There are a lot of things behind the scenes that I can think of which will have an undefined behavior if you do this.

As was suggested, I’d use WebContainers for the things you want on every page.[/quote]

With webcontainers and more than 25+ pages this is not what i want.
If one of those pages need to change some code, or place the container on another location it would take ages.

Pure inefficiency. Look at other tools, they have some AWSOME usefull features, the masterpages is only one of those.

Why not build your pages as containers and swap them in and out of a single “master” page at runtime?

Ah, yeah well that can be done.

So then i would have 1 WebPage and a ton of containercontrols?
If they behave like 100% as webpages then it would be a possible option.

Your one of the devs so let me know if they are the same in behaviour.

Not anymore, but yes it’ll work. WebPage and WebContainer are each just WebView controls with very minor differences.

Are you saying your not working fro Xojo anymore?

Awesome, ill try it. Thanks for the info.