How can i build a MasterPage effect.

Yes.

That means something. Well i din’t think you would ever get out. But i think this isn’t a good step for this product.

I’m quite sad to hear this. I used this feature from time to time w/o trouble. If this statement reflects an official decision, please instruct the IDE to not allow this, as you do already with Desktop Views. Currently there are two ways to create a subclass of an WebContainer:

  1. Add a Class, change the Super → subclass has no WebView Editor in IDE
  2. Add a Container, change the Super → Subclass has an WebView Editor in the IDE
    the second should then be made impossible. Also my Feedback request to visually show the inherited controls at <https://xojo.com/issue/30642> can be closed with an appropriate statement.
    Please note that this change (as in enforcement of original intention) will break existing code and should be properly documented.

Wow…the most important info I gathered here is that Thom McGrath is no longer with XOJO development. Indeed Thom was a valuable and excellent forum resource. He will be missed. I glad he still chimes in time to time (like this thread) to help out. I’ve used the web container on a “master page” to better “center” a cluster of controls (typically user login info) – while you can center individual controls on a page….because controls may have differing sizes (like buttons versus labels and tex boxes) changing the page size could result in some poor control alignment. Placing all the controls in a container…and then centering that single control works nicely.

Don’t worry, I’m not going away. I’ve got two talks at XDC next year, I’m still in touch with Geoff, and I’ve been working on some cool stuff with Jared to help the community.

Thom,
When you say “Why not build your pages as containers and swap them in and out of a single “master” page at runtime?” what’s the best way to swap them in and out? I am just getting back into Xojo after a number of years away and Xojo Web is still new to me. I understand the concept of a MasterPage, just trying to see if it makes sense to try to use it in my project, of if it’s just better to include those components on each page, which sort of defeats the purpose of the MasterPage… lol

WebContainers can be added or removed from the master page with embedwithin and Close to remove it. What you do is to use a WebContainer property on the WebPage to retain a reference to the WebContainer :

myWebContainer as WebContainer
For instance

myWebContainer = New theWebContainer myContainer.Embedwithin(self, 0,0, myWebContainer.width, myWebContainer.height)

So afterward when you want to remove it, you simply do

myWebContainer.Close

I will try playing with it. Seems like dynamically adding webcontainers might be an interesting way to create something that looks more like a website than a web app, which is something I am interested in doing.

i ask myself if it’s possible to use the technique of a “MasterPage” in relation with handleurl ?!?

i want’t to show customized containers when starting new user session with parameter… any ideas or code welcome

Bjorn,
I will be doing something similar in a project in about a month. I will be basing it on whether they are logged in or not, and if they are logged in, I want to show a different home page. I want to see if this technique of using containers with and without a “MasterPage” is going to work.

Just doing a proof of concept app right now.

I have a toolbar that has an open and close button.

When I MouseDown the Open I do the following:

[code] dim TestCC as new AlanCC

testcc.EmbedWithin(self,25,25,testcc.Width,testcc.Height)[/code]
where AlanCC is a Container Control that I create.

That works great. I have a button on the AlanCC control that does a:

self.close

but really I want to close it with the close button on the Toolbar.

In the ToolBar “close” button, I put:

TestCC.close

but the compiler says it can’t find TestCC. What code do I put there to close the AlanCC container when I’m not inside the actual container.

It’s probably very simple, but I’m missing it.

Thanks

[quote=271911:@Björn Dohle]i ask myself if it’s possible to use the technique of a “MasterPage” in relation with handleurl ?!?

i want’t to show customized containers when starting new user session with parameter… any ideas or code welcome[/quote]

HandleURL does not give you access to the webpages and WebContainers. What do you want to achieve exactly ?

[quote=271921:@Alan Sawyer]dim TestCC as new AlanCC

testcc.EmbedWithin(self,25,25,testcc.Width,testcc.Height)[/quote]

Here is your problem : Testcc does not exist out of the method/event where you declared it.

Instead, make testcc a WebContainer property of your WebPage, and close will work.

When I do this it compiles and runs, but when I click on the Close button in the Toolbar, it throws some sort of an error on the TestCC.Close statement, though I can’t tell what the actual error is.
Again, I’m sure it’s something simple that I’m not understanding.

I did try changing the Scope of the TestCC webcontainer, but that didn’t change anything, I still get the error,.

I had to change my

Dim TestCC as new AlanCC

to

TestCC = new AlanCC

which makes perfect sense.

It’s working now.

If you don’t tell me more about “some sort of error” I cannot help much.

  • Add TestCC as WebContainer to the WebPage
  • Modify your code as such :

[code]TestCC = new AlanCC

testcc.EmbedWithin(self,25,25,testcc.Width,testcc.Height)[/code]