Element Factory

Introduction

ElementFactory is the API exposed by Dynamo for creating Dynamo Elements. It's use is abstracted in the createElement library.

Element Factory Overview

The ElementFactory object is exposed to the processor's context and is accessible using -

this.elementFactory;

The ElementFactory object has two methods

this.elementFactory.get(ElementOpts);

and

// this internally calls the .get method
this.elementFactory.getAll(this, [ElementOpts]);

The get method returns a single Dynamo Element on which you can call either the describeSync or the describe method of the element. Example usage -

this.elementFactory.get(ElementOpts).describeSync();

Element Properties

Property NameTypeDescription
nameStringThe name of the element. This is the name with which the element value will be accessed in the form arguments.
elementTypeStringOne of the valid element types that have been defined in dynamo constants.
labelStringThe label/ placeholder associated with the element
descriptionString?The description for the element if needed
argsObjectThe element specific options, it is usually different for various elements
asyncValidatorsArray?An array of async functions that would be run to perform some validation on the element
validatorsArray?An array of synchronous validators that will be run to validate the elements value. Includes the validators found in forms and elements.
uidStringThe unique ID for the element
orderNumberDisplay order on the form for the element. Determines the position of the element on the form
component_uidString|UUIDGlobally unique ID for the element