preloadInstance method

void preloadInstance(
  1. TreeElement node
)

Applies the jr:preload values to node and its descendants (templates excluded).

Implementation

void preloadInstance(TreeElement node) {
  final handler = node.preloadHandler;
  if (handler != null) {
    final preload = preloader.getQuestionPreload(handler, node.preloadParams);
    if (preload != null) node.setAnswer(preload);
  }
  for (final child in [...node.children]) {
    if (child.multiplicity != TreeReference.indexTemplate) {
      preloadInstance(child);
    }
  }
}