renderForm()

Overview

public string function renderForm(
      required string  formName               
    ,          string  mergeWithFormName       = ""
    ,          string  context                 = "admin"
    ,          string  fieldLayout             = "formcontrols.layouts.field"
    ,          string  fieldsetLayout          = "formcontrols.layouts.fieldset"
    ,          string  tabLayout               = "formcontrols.layouts.tab"
    ,          string  formLayout              = "formcontrols.layouts.form"
    ,          string  formId                  = ""
    ,          string  component               = ""
    ,          any     validationResult        = ""
    ,          boolean includeValidationJs     = true
    ,          string  validationJsJqueryRef   = "presideJQuery"
    ,          struct  savedData              
    ,          struct  additionalArgs         
    ,          string  fieldNamePrefix         = ""
    ,          string  fieldNameSuffix         = ""
    ,          array   suppressFields         
    ,          boolean stripPermissionedFields = true
    ,          string  permissionContext       = ""
    ,          array   permissionContextKeys  
)

Renders the given form

Arguments

NameTypeRequiredDescription
formNamestringYesName of the form to render
mergeWithFormNamestringNo (default="")Name of a secondary form to merge with the primary form
contextstringNo (default="admin")Context in which to render the form, e.g. 'admin' or 'website'. See Rendering Preside form definitions for more details.
fieldLayoutstringNo (default="formcontrols.layouts.field")Viewlet for rendering a field layout. See Rendering Preside form definitions for more details.
fieldsetLayoutstringNo (default="formcontrols.layouts.fieldset")Viewlet for rendering a fieldset layout. See Rendering Preside form definitions for more details.
tabLayoutstringNo (default="formcontrols.layouts.tab")Viewlet for rendering a tab layout. See Rendering Preside form definitions for more details.
formLayoutstringNo (default="formcontrols.layouts.form")Viewlet for rendering an overall form layout. See Rendering Preside form definitions for more details.
formIdstringNo (default="")HTML ID of the wrapping form element. This is used for the js validation logic if generated.
componentstringNo (default="")
validationResultanyNo (default="")An existing validation result object with which to display errors in the form (see Validation framework and Preside form validation for more details)
includeValidationJsbooleanNo (default=true)Whether or not to generate and include validation javascript with the form
validationJsJqueryRefstringNo (default="presideJQuery")
savedDatastructNoStructure of pre-existing data with which to pre-populate values in the form
additionalArgsstructNoStructure of additional dynamic args to be passed to the renders of fields, fieldsets and tabs. See Rendering Preside form definitions for more details.
fieldNamePrefixstringNo (default="")A prefix to add to each field name
fieldNameSuffixstringNo (default="")A suffix to add to each field name
suppressFieldsarrayNoAn array of field names to hide from the rendering
stripPermissionedFieldsbooleanNo (default=true)
permissionContextstringNo (default="")
permissionContextKeysarrayNo