1.13 Render type (Experimental)

Some metadata types have a property named renderType . The render type property is a map between a device and a renderingType . Applications can use this information as a hint on how the object should be rendered on a specific device. For example, a mobile device might want to render a data element differently than a desktop computer.

There is currently two different kinds of renderingTypes available:

  1. Value type rendering

  2. Program stage section rendering

There is also 2 device types available:

  1. MOBILE

  2. DESKTOP

The following table lists the metadata and rendering types available. The value type rendering has addition constraints based on the metadata configuration, which will be shown in a second table.

Metadata and RenderingType overview
Metadata type Available RenderingTypes
Program Stage Section
  • LISTING (default)

  • SEQUENTIAL

  • MATRIX

Data element
  • DEFAULT

  • DROPDOWN

  • VERTICAL_RADIOBUTTONS

  • HORIZONTAL_RADIOBUTTONS

  • VERTICAL_CHECKBOXES

  • HORIZONTAL_CHECKBOXES

  • SHARED_HEADER_RADIOBUTTONS

  • ICONS_AS_BUTTONS

  • SPINNER

  • ICON

  • TOGGLE

  • VALUE

  • SLIDER

  • LINEAR_SCALE

Tracked entity attribute

Since handling the default rendering of data elements and tracked entity attributes are depending on the value type of the object, there is also a DEFAULT type to tell the client it should be handled as normal. Program Stage Section are LISTING as default.

RenderingTypes allowed based on value types
Value type Is object an optionset? RenderingTypes allowed
TRUE_ONLY No DEFAULT, VERTICAL_RADIOBUTTONS, HORIZONTAL_RADIOBUTTONS, VERTICAL_CHECKBOXES, HORIZONTAL_CHECKBOXES, TOGGLE
BOOLEAN No
- Yes DEFAULT, DROPDOWN, VERTICAL_RADIOBUTTONS, HORIZONTAL_RADIOBUTTONS, VERTICAL_CHECKBOXES, HORIZONTAL_CHECKBOXES, SHARED_HEADER_RADIOBUTTONS, ICONS_AS_BUTTONS, SPINNER, ICON
INTEGER No DEFAULT, VALUE, SLIDER, LINEAR_SCALE, SPINNER
INTEGER_POSITIVE No
INTEGER_NEGATIVE No
INTEGER_ZERO_OR_POSITIVE No
NUMBER No
UNIT_INTERVAL No
PERCENTAGE No

A complete reference of the previous table can also be retrieved using the following endpoint:

GET /api/staticConfiguration/renderingOptions

Value type rendering also has some additional properties that can be set, which is usually needed when rendering some of the specific types:

renderType object properties
Property Description Type
type The RenderingType of the object, as seen in the first table. This property is the same for both value type and program stage section, but is the only property available for program stage section. Enum (See list in the Metadata and Rendering Type table)
min Only for value type rendering. Represents the minimum value this field can have. Integer
max Only for value type rendering. Represents the maximum value this field can have. Integer
step Only for value type rendering. Represents the size of the steps the value should increase, for example for SLIDER og LINEAR_SCALE Integer
decimalPoints Only for value type rendering. Represents the number of decimal points the value should use. Integer

renderingType can be set when creating or updating the metadata listed in the first table. An example payload for the renderingType looks like this:

Program Stage Section:
{
  ...
  "renderingType": {
    "type": "MATRIX"
  }
  ...
}

Value type (Data Element, Tracked Entity Attribute)
{
  ...
  "renderingType": {
    "type": "SLIDER",
    "min": 0,
    "max": 1000,
    "step": 50,
    "decimalPoints": 0
  }
  ...
}