0 votes
1.1k views
by (120 points)

1 Answer

0 votes
by (30.6k points)

"Lazy loading" in BPM means rendering or loading parts of a coach only when they are needed instead of at page load. Three mechanisms, from cheapest to most elaborate:

  • UI Toolkit visibility: a section that is Hidden (not just invisible) is not rendered at all until its visibility changes; the Tab Section renders tabs lazily by default (Lazy render option) - the content of a tab is built when the tab is first shown. Use this for heavy tabs and collapsed panels (Collapsible Panel with "render on expand").
  • Lazy data: load only the data of the visible part - bind a table to a page of records and fetch the next page with a Service Call when the user pages or scrolls (the table's pagination options); load detail objects when a row is selected instead of sending every detail to the browser.
  • Custom coach view that defers rendering: in its load handler register an IntersectionObserver and build the DOM when the element scrolls into view; or render on a control event.
// custom view: render only when visible
var me = this, el = this.context.element, done = false;
var io = new IntersectionObserver(function (entries) {
  if (done || !entries[0].isIntersecting) return;
  done = true; io.disconnect();
  me.render();                                    // heavy DOM / chart build
});
io.observe(el);

What lazy loading cannot fix: a huge tw.local sent to the browser at coach start (all coach data is serialised with the page) - reduce the data or load it with services; and slow services called in the coach's load event - call them before the coach or in parallel (question 3122). Question 709 covers lazy loading of child coach views specifically.

References

Related questions

0 votes
1 answer 1.5k views
0 votes
1 answer 793 views
0 votes
1 answer 1.1k views
0 votes
1 answer 1.3k views
asked Oct 4, 2016 by sravan93 (200 points)
+1 vote
1 answer 924 views
0 votes
2 answers 2.2k views
asked Dec 14, 2016 in Coach Views by venkat (2.1k points)
0 votes
1 answer 473 views
asked Dec 14, 2016 in Coach Views by venkat (2.1k points)

723 questions

807 answers

98 comments

4.9k users

Join BPM Community Discord Channel

Welcome to BPM Tips Q&A, Community wiki/forum where you can ask questions and receive answers from other IBM BPM experts and members of the community. Users with 2000 points will automatically be promoted to expert level.
Created by Dosvak LLC
Our Youtube Channel
...