Webpage width & height changes after logout

Basically this test WebApp has a login page followed by a WebPage with Toolbar and a few Buttons

To see this “Webpage width & height changes after logout” you will need to download a sample file. The WebPage width and Height are grabbed when the page opens.

Here is the Test WebApp link to a XOJO DropBox folder
TEST web app

Instructions for use are contained in the WebArea

The question is how to enable getting the current web page size so the containers can be sized correctly after logout and then when you log back in

Once I get this to work I need to find out how to do an active resize

[quote=209881:@Carl Fitzsimmons]Basically this test WebApp has a login page followed by a WebPage with Toolbar and a few Buttons

To see this “Webpage width & height changes after logout” you will need to download a sample file. The WebPage width and Height are grabbed when the page opens.

Here is the Test WebApp link to a XOJO DropBox folder
TEST web app

Instructions for use are contained in the WebArea

The question is how to enable getting the current web page size so the containers can be sized correctly after logout and then when you log back in

Once I get this to work I need to find out how to do an active resize[/quote]

The project won’t run without the pictures :frowning:

Sorry about that. Pic resources are now available in Resource folder

Carl, I am sorry, but the pictures are still missing. I ended up creating a series of grey icon pictures to replace the missing ones and be able to run the project.

From what I can see, the value of width and height in ToolBarPage Resized event is the right browser window size. It is constant in Login as well.

Which platform and browser are you encountering an issue with ?

Michael,
Here is the Pic link - Pics

When you login first time everything is good. Logout and then back in without resizing. Then click on ‘Cover’ WebButton. The container comes back different size

I am using MAC OS X 10.10.5. XOJO 2015 2.4. Tested on both Safari 8.0.8 or Firefox 39.0

Here are a series of pics
Login

Loged in screen

First click

Now log out and do second login

Second click of Web Button showing container size is different

If you resize then click on Web Button the container size is corrected

I do not think the issue is the page height reported by Xojo. It seems more of a bug in the way you instanciate the container the second time around.

Do you suggest another way to instantiate the container second time around or do you suggest this may be a bug?

I think somehow the method you use to instanciate the container is flawed in the way it sets the height of it. There is no objective reason why it should chose to set it to about half the height the second time. That is, IMHO, a bug.

Thanks - I will submit a bug report and shall see what happens

If you have any other thoughts about a different way to do this please let me know and thanks for taking a look

[quote=210115:@Carl Fitzsimmons]Thanks - I will submit a bug report and shall see what happens

If you have any other thoughts about a different way to do this please let me know and thanks for taking a look[/quote]

I am sorry. I do not think it is a bug in Xojo. I think it has to do with the way you manage your container that is not consistent between the two displays. Possibly because a variable is modified in between.

I tried to place a fixed value in SGC_Toolbar BuutonAction here (last line, 700)

[code] Case “Coversheet”

If mHelpSheetContainers(0) <> Nil Then
  mHelpSheetContainers(0).Close
  mHelpSheetContainers(0) = Nil
End If

If mSheetContainers(0) <> Nil Then
  mSheetContainers(0).Close
  mSheetContainers(0) = Nil
End If

If mSheetContainers(0) Is Nil Then
  Dim dc As New mSiteInfoContainer
  Dim Top_Space_Height As Integer = TextField1.Top + TextField1.Height + SCG_Toolbar.Height + 20
  Dim Page_Space_Width As Integer = ToolbarPage.Width - 80
  Dim Page_Space_Height As Integer =  ToolbarPage.Height - (TextField1.Height + SCG_Toolbar.Height) - 80
  
  dc.EmbedWithin(Self, _
  TextField1.Left + 40, _
  Top_Space_Height, _
  Page_Space_Width, _
  700)[/code]

The bug no longer manifests. That leads me to believe that somehow, Page_Space_Height is not consistent between two login/logout. You may want to initiate this value in WebPage Resize instead.

@Michel Bujardet - I have looked for such a modification and none exist. Page_Space_Height and Page_Space_Width are dynamically calculated per this aspect of the code

Dim Page_Space_Width As Integer = ToolbarPage.Width - 80 Dim Page_Space_Height As Integer = ToolbarPage.Height - (TextField1.Height + SCG_Toolbar.Height) - 80
directly from current page values and only exist within ToolbarPage

No where in the app are ToolbarPage.Height or ToolbarPage.Width forced to change their width. The static values placed in the IDE also do not match the width or height values. Somehow those two page values are being over written and I am fairly clear that the code I have written in this app does not modify them.

I just do not see where the width and height values could be getting over written

OK. I think I found where the bug is.

I placed this in TollBarPage Resied event :

system.DebugLog str(self.Height)

First time around, it shows 906, which is correct for my browser size.

Second time around, it shows 626, which I bet could be the design size of your web page.

At any rate, the only time when the size of the window is right is the first time ToolBarPage resizes, OR when the user resizes by changing the window size.

If by any chance 626 is the design height, then you could instead of ToolBarPage.Height use PageHeight you set in Resize with JustOpening, and only reset them if the size is not the design size.

You can also distinguish between a manual resize from the user and the one that happens upon shown because the second happens within a tick or two after the page opens.

Very cool Michel. I will give that a try. I have opened a Bug case #40604 still waiting for review. Please consider adding what you found.