Forum Stats

  • 3,780,535 Users
  • 2,254,407 Discussions
  • 7,879,374 Comments

Discussions

refresh a page versus opening a page

Geert01
Geert01 Member Posts: 137 Bronze Badge

I am creating an application to be used on a mobile. One of the pages shows some text and images. In the 'Execute when Page Loads' section, I change the size of the images. When the page loads the page is initially rendered with the default size of the images. After a short while, the resizing of the images comes into effect and they get their final size.

In order to not have the page 'change' between the initial rendering and the resizing, I have added a blank region that gets hidden after 200 mili seconds via

apex.jQuery(window).on('theme42ready', function() {  setTimeout(function(){ $('#BlankPageRegion').hide() }, 200);});

This is an ugly solution, but it works.

But it only works when the page gets called via a link on another page. When the page is loaded and the users refreshes the page (without going to another page and coming back) the 'BlankPageRegion' does not seem to be rendered, and the users once again sees the images in the original size and shortly afterwards, the images resize.

What is the best solution to not have the page change after the first rendering?

Tagged:

Best Answer

  • fac586
    fac586 Senior Technical Architect Member Posts: 20,314 Red Diamond
    Accepted Answer

    I am creating an application to be used on a mobile. One of the pages shows some text and images.

    How? Which APEX components are used in doing this?

    In the 'Execute when Page Loads' section, I change the size of the images.

    Why? How?

    When the page loads the page is initially rendered with the default size of the images. After a short while, the resizing of the images comes into effect and they get their final size.

    Why "after a short while"?

    What is the best solution to not have the page change after the first rendering?

    Virtually any other way than is being used now. I'm thinking picture element, APEX responsive classes, CSS...

Answers

  • Mike Kutz
    Mike Kutz Member Posts: 5,938 Silver Crown

    I've seen this problem occur ever since the NCSA browser.

    It's because the browser has to do the resizing.

    I recommend you use an image that is the correct size to begin with.

  • fac586
    fac586 Senior Technical Architect Member Posts: 20,314 Red Diamond
    Accepted Answer

    I am creating an application to be used on a mobile. One of the pages shows some text and images.

    How? Which APEX components are used in doing this?

    In the 'Execute when Page Loads' section, I change the size of the images.

    Why? How?

    When the page loads the page is initially rendered with the default size of the images. After a short while, the resizing of the images comes into effect and they get their final size.

    Why "after a short while"?

    What is the best solution to not have the page change after the first rendering?

    Virtually any other way than is being used now. I'm thinking picture element, APEX responsive classes, CSS...

  • Geert01
    Geert01 Member Posts: 137 Bronze Badge

    I will create an example page on apex.oracle.com and come back to you. Thanks for helping!

    fac586
  • Mike Kutz
    Mike Kutz Member Posts: 5,938 Silver Crown


    Please ensure you create a Developers account for us to use so that the spam bots not harvest your email address.

    (Also, please post the neccesary info for us to look at app)

  • Geert01
    Geert01 Member Posts: 137 Bronze Badge

    While recreating (partially) the application I figured out how to solve my problem. I still do not know why refreshing the page does not seem to render the 'blank lines' region, but by using the HTML Expression field of the image column I managed to insert the (dynamically determined) image size, so the image resize action in the Execute on Page load is no longer needed and the page no longer 'changes' after the initial load.

    Thank you all for your willingness to help!