Akumina Developer Documentation

Akumina Developer Documentation

  • API
  • Docs
  • Blog

›Widget Info

Akumina

  • Quickstart

Yo Akumina

  • Yo Akumina
  • Start with Yeoman
  • React
  • Simple template

Widget Builder

  • Widget Builder Structure
  • Akumina Widget Builder
  • Skipping instances
  • Token replacement for widget properties

Widget Development Quickstart

  • Setting up the Project
  • Configuring .env file
  • Configuring - akumina.sitedployer.config.json file
  • Configuring - akumina.config.json file
  • Extras

Widget Info

  • Akumina Widgets Overview
  • Building a New Widget Instance
  • Widget Views
  • Widget Properties
  • Global vs Local widgets (Widget Scoping)
  • Akumina React Widgets
  • Callbacks
  • RenderChildWidgets
  • Vendor Package List

Virtual Page Builder

  • Akumina Virtual Page Builder
  • Using Virtual Page Layouts
  • Creating a Custom Layout

Stream Card Builder

  • Installation
  • Stream Card Builder
  • Custom Cards
  • Activity Comments Config
  • Akumina Activity Stream PUSH Subscription using PowerAutomate to connect to ServiceNow
  • Akumina Activity Stream PUSH Subscription using PowerAutomate to connect to Dynamic 365

Site Deployer

  • Overview
  • Version 6.0
  • List Attribute Deployments
  • NPM Commands
  • SPA Updates and Deploying to multiple sites

Authoring

  • Content Action Event
  • Publish Validation Integration
  • Field Event Integration
  • CK Editor external plugins

Headless

  • Quickstart
  • Headless Teams support
  • Headless Troubleshooting

Modern

  • Overview
  • FAQ
  • Single Page Application
  • Modern Web Part Library
  • Google Analytics for Modern Pages

Site Creator

  • Overview
  • Adding A Custom Site Definition
  • Core Step Classes
  • Custom Site Definition Components
  • Custom Site Definition XML
  • Custom Subsite Definitions
  • Sample Step Code
  • Supported Tokens

Azure DevOps

  • CI/CD using Azure DevOps
  • Setting up a build to deploy a site package
  • Setting up a build to deploy file to App Manager hosted in an app service

Configuration

  • Configuration Context Overview
  • Edit the Redis cache timeout
  • Using a key vault for the client id and client secret

Debugging

  • Debugging in Akumina

Advanced

  • Central Site Collection Support
  • Eventing OOB Digital Workplace Events
  • Working with custom JSX Views
  • Page Indexing

Service Hub

  • Quickstart

Patch Notes

  • Patch Notes

RenderChildWidgets

Overview

The purpose of this article is to explain and demonstrate usage of the Akumina.Digispace.Data.WidgetManager().RenderChildWidgets functionality provided with the Akumina Framework. The RenderChildWidgets functionality is available in Akumina Framework version 4.5 and higher.

What is it?

RenderChildWidgets offers the ability to render a widget embedded into another widget. Although this usage may be niche, it may be useful should the situation arise. By default, when loading a page, the Akumina Framework will scan the page to look for widget placeholders, such as the following example:

<div rel="VirtualPageWidget" class="ak-page ak-widget" id="2656b679-1a51-9966-0170-14e8a3584975"></div>

When the above DOM element is found, the Akumina Framework goes through the process of bundling the widget assets, initializing individual widgets, so on and so forth. The problem, however, is that a widget placeholder embedded into the view of another widget is not automatically rendered by the Framework because it does not exist on the page until after the scan has been initialized. This is the benefit of RenderChildWidgets.

How does it work?

The RenderChildWidgets functionality is a manual call in the widget javascript. The method signature is:

RenderChildWidgets(selector: string, pageId: string | null, mode: string): void;

The selector param is a jquery selector string. The pageId param is a string indicating the ID of the page, this parameter is optional. The mode param indicates the mode the widget should be rendered in. Possible values are "view" and "edit".

The RenderChildWidgets call must be made after the widget's view has been parsed by the Handlebars helper and rendered to the page. Example usage:

private renderTemplate() {
    try {
        let wiid: string = this.im.DivId;
        // Parse widget template
        new Akumina.Digispace.AppPart.Data().Templates.ParseTemplate(this.im.DisplayTemplateUrl, this.im).then(html => {
            // Render parsed template to page
            this.setHtml(wiid, html);

            // Render Child Widgets
            var widgetManager = new Akumina.Digispace.Data.WidgetManager();
            widgetManager.RenderChildWidgets("#" + wiid + " .ak-widget", null, "view");
            Akumina.Digispace.AppPart.Eventing.Publish("/widget/loaded/", { properties: this.im.properties });
        }
    }
}

private setHtml(divId: string, html: string) : void {
    $("#" + divId).html(html);
}

The RenderChildWidgets functionality will use the provided jQuery selector to find the widget div placeholder and initialize it through the framework, rendering it in the given view state.

← CallbacksVendor Package List →
  • What is it?
  • How does it work?
Akumina Developer Documentation
Docs
Akumina Framework 5.0Akumina Widget BuilderAkumina Yeoman GeneratorSite Deployer
Community
Akumina Community Site
More
GitHubStar
Copyright © 2024 Akumina