Show TOC

Creating Blocks: A Step-by-Step GuideLocate this document in the navigation structure

This guide outlines the most important points when creating Blocks for the Object Page

Decide which kind of block to use:

  • Single view block if Collapsed, Expanded and Compact modes are similar and easy to develop with a single view.

  • Multiple view blocks if it’s easier to provide different views for the different modes.

  • Free form if none of these suit your needs.

Single View Block Creation

  • Create the block folder in the source control of the application.

  • Add a BlockName.js which extends BlockBase.
    Note

    Naming guideline: The Block name should end with the word Block.

  • Add a BlockName.view.xml XML view.

  • If needed, add the associated controller: BlockNameController.controller.js

Multiple View Block Creation

  • Create the block folder in the source control of the application.

  • Add a BlockName.js which extends BlockBase.

  • Declare the views to be used for the different modes in the views section of the metadata.

  • Add the Expanded and Collapsed XML views.
    Note

    Naming guideline: Call these files BlockNameCollapsed.view.xml, BlockNameExpanded.view.xml

  • If needed, add the associated controllers. Whether you use the same controller for all views or one controller per view is your decision.

Free Form Block Creation

  • Create the block folder in the source control of the application.

  • Add a BlockName.js which extends BlockBase.

  • Override the setMode function - from here on, all changes are up to you.