Web page width & height properties correct then incorrect

I have one Web page, and its width & height properties return the correct dimensions when polled with a timer after the browser window is resized. This works with both Firefox and IE on Windows.

The first web page shows a second web page after a label in a container is clicked on the first web page.

When the second web page is resized, the width and height properties are not being updated. But if I click a button which shows the first Web page again, they work again on the first page correctly returning the new width and height of the page when polled by the timer since the browser was resized while on the previous page.

Any ideas how to get the correct width & height of web pages following the first web page?

Thanks,

Eric

[quote=208172:@Eric Wilson]I have one Web page, and its width & height properties return the correct dimensions when polled with a timer after the browser window is resized. This works with both Firefox and IE on Windows.

The first web page shows a second web page after a label in a container is clicked on the first web page.

When the second web page is resized, the width and height properties are not being updated. But if I click a button which shows the first Web page again, they work again on the first page correctly returning the new width and height of the page when polled by the timer since the browser was resized while on the previous page.

Any ideas how to get the correct width & height of web pages following the first web page?
[/quote]

In my experience, no need for a timer. When a WebPage opens and displays for the first time, the first resized event gives you the design dimensions, then in the subsequent events WebPage.Width and WebPage.Height correctly report the browser inner window size.

The only exception is when the window minWidth or minHeight are larger than the browser window size, which means they scroll. Then the reported width or height is that of the minWidth or minHeight.

My class RubberViewsWE makes intensive use of WebPage.Width and WebPage.Height in Resized, and it works perfectly with IE and Firefox Windows.

See the online demo app at http://rubberviews.com/cgi-bin/rubberviewswe/rubberviewswe.cgi

Click on the green top buttons to see the other pages, which are correctly resized.

If you do not see that, maybe you want to build a simple project that demonstrates the issue ? I will be glad to give it a look.

Thanks for your reply Michel.

My first page has controls which scale using this technique. I would like to do the same with the second page but can’t because the properties are not returning the changed size. This is odd because when I don’t use a timer but use the resize event, the new height and width values are not reported there either even though the event fires because they have changed…

I note scroll bars appear on the second page when it is resized because the container becomes bigger than the viewport… Thus it seems page size <> viewport size for the second page. Is there any way to get the new size of the display area as it does on the first page when it’s re-shown?

But the second page does seem to report the dimensions correctly if the viewport is larger than the container: i.e. no scroll bars.

Then it is alright ?

No Michel, I need to suppress the web page’s scroll bars to get the correct values as I notice they are suppressed in my previous page, but I can’t see or recall how I did it!

Set minwidth < width and minHeight < height

That was the way I did it with the first Web page which didn’t work with the second web page.

I have now tracked down this issue to be triggered by a self.show command surplus to requirements in an implicit instance web page, which seems to have auto-show behaviours when the first page is closed and doesn’t require self.show. The extra self.show in a method then seems to have mucked up the Web page’s expected height and width properties and scroll bar suppression in R2015/2.2.