243
Views
3
Comments
[How To - Lazy load] LazyLoad blocks any link click
Question
lazyload-png
Web icon
Forge asset by Francisco Menezes

Hi,

I tried this on version 9 on development env. I have a homepage with some components with lazy load and with a menu. If I click on any link of the menu the new page only start opening when the lazy load finish his job. Will this be different in a production env?

2016-04-21 20-09-55
J.
 
MVP

afaik nope,


You should check out the other lazy-load with fakenotify and multiple loads.

there you have something like end up soemthing like:

if(!window.LateLoadQueue) {window.LateLoadQueue = [];}
window.LateLoadQueue.push({ weight: "+PriorityWeight+", id: '" + NotifyWidget.Id + "'});
window.LateLoadQueue.sort(function(a, b) {return a.weight < b.weight;});
$( document ).ready(
    function () { 
        for(i = 0; i < window.LateLoadQueue.length; i++) {
          if(lazyLoadPropogation) {
            OsNotifyWidget(window.LateLoadQueue.shift().id, '');
          }
      }
    }
);

there you can hook a js-variable to see if you really want to notify or something else has propagated.

when clicking on any link, you should set that variable to false and the next time the fakenotify is being called it will stop.

2019-05-22 11-30-09
Marcelo Ferreira

That helps to change page between different blocks loading. But if one block takes 1 min to load and the link click happen during the load of that block the user will wait 1 min for the page to change. There is anyway of avoiding this?

Thx in advance.

2019-07-08 11-04-35
Leonardo Fernandes
 
MVP

Hi Marcelo.

Your pages shouldn't take up to 1 minute to load, anyway.

What happens here is that the platform serializes dynamic web requests for the same session. That is done by design mainly to prevent inconsistent state in session objects. Imagine having two different requests reading and writing concurrently to the same session object.

I don't think there's any way around this mechanism. But, if your menu links are navigate (or submit), your browser should give priority to it and in that case it would be the next web request to be served. So you would have to wait, at most, the time for the current lazy web block to load.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.