createForm()

Overview

public string function createForm(
      any    generator
    , string basedOn   = ""
    , string formName 
)

Creates and registers a new dynamic form. Supply a 'generator closure' to add code to help generate the form definition. Closure accepts a FormDefinition argument as the first argument. e.g.

createForm( function( formDefinition ){

formDefinition.addField( name="myfield", fieldset="default", tab="default" );

} );

Arguments

NameTypeRequiredDescription
generatoranyNoClosure that accepts as its first argument a FormDefinition object so that calling code can build the form definition.
basedOnstringNo (default="")Name of the form to base the new dynamic form on. Generator closure will take the full definition of the original form so that it can then make modifications and additions that it needs
formNamestringNoIf supplied, specifies the name of the form that will be registered. If not supplied, a name will be generated based on the unique full definition of the form. Warning, if using this argument, ensure that the name will be unique for each distinct form definition.