Review Board 1.5.4

Fix for issue 56: Add lazy loading on lift

Updated 2 years, 2 months ago

Marius Danciu Reviewers
marius-wip-issue-56
56 dchenbecker, dpp, marius, charles, joni, atsuhiko, jorge, naftoli, kris, indrajit, alexb
None LiftWeb-archive
To load lazily a page fragment that may or may not include snippets just wrpa the markup in:

<lift:lazy-load>
  // Some markup here
</lift:lazy-load>

Thanks to a recent fix made by Dave, during the Ajax calls, the state (RequestVars, StatefulSnippet-s etc) previously set during page rendering pipeline is preserved 

Ignore the functions submitJsonForm/submitAjaxForm from the diff as they pertain to issue 149, which is also on the review board. :D
Loaded asynchronously a JSON form. Worked well.
Posted 2 years, 3 months ago (November 2nd, 2009, 1:10 p.m.)
I'm not keen on this implementation.  If there are multiple items on the page, they will not arrive in order.  If they take longer than the Ajax timeout to render, they won't be rendered.

I would suggest piggy-backing on the comet mechanism for this such that a short-lived comet component monitors the rendering and returns the component when rendering is complete.
  1. What concerns me with the Commet approach is that in the LazyLoad snippet we'd fork the xhtml processing to an Actor and the state may be destroyed by Lift when sending the response to the client so the async processing is loosing the potentially needed state. I wonder if we can use the contextFuncBuilder mechanism here to make sure that while we;re doing the async processing we don;t loose any state. 
    
    Thoughts ?
Review request changed
Updated 2 years, 2 months ago (November 14th, 2009, 9:55 a.m.)
I changed the implementation to use CometActors. Please take a look. It is working fine for me.
Ship it!
Posted 2 years, 2 months ago (November 14th, 2009, 4:33 p.m.)
Roll it on in!  Awesome stuff!  Please make sure this is prominent in the changes.xml file