FormBase (open)
Form base object
Syntax
LOADLIB "mod::publisher/lib/forms/base.whlib";
OBJECTTYPE FormBaseConstructor
Variables
- STRING formbacklink
"Previous" page link for the first form page
- BOOLEAN formcheckratelimits
Whether to do a rate limit check at first BeginWork. Enabled by external submissions
- STRING ARRAY formclasses
Additional form classes
- RECORD formdataset
Custom data attributes
- STRING formid
Form ID (generally used for analytics)
- STRING formidprefix
prefix for ids. clear to disable ids
- STRING formjshandler
Form JS handler. Defaults to publisher:rpc
- STRING formnextlabel
Label for 'next page' buttoon
- STRING formprevlabel
Label for 'previous page' buttoon
- STRING formref
Form reference (persisted over RPCs, seen and possible modifyable by clients so should not contain sensitive or replayable data)
- STRING formsubmitlabel
Label for 'submit' buttoon
- STRING formsubmittype
Form submittype (new or edit)
- RECORD pagedata
- BOOLEAN selecthistoricvalues
Allow historic values to be selected
Properties
- PROPERTY formapplytester
Applytester for the form
- PROPERTY formcontext
Webcontext for the form
- PROPERTY formisinitialrender
Whether this is the initial render of the form (FALSE within submit / RPC calls)
- PROPERTY formlanguagecode
Language for the form
- PROPERTY formrenderer
Rendering engine for this form
- PROPERTY formurl
URL for the the form
- PROPERTY formvalue
The current value of the form as a record
- PROPERTY formvariables
Form variables are one way communication from the server to the client and can be used in conditions (using FCFormVariable) You can setup flows where the client modifies form variables to affect the result of visible/enabled/required conditions, but the server will ignore these changes. The server will also ignore changes made to formvariable calls in RPCs (as it would need to trust the client about the changes).
Functions
- MACRO AddFormAttributesCallback(MACRO PTR toadd)
Register form attributes callbacks, use by fields that (only) need to add data to the
<form> - OBJECT FUNCTION AppendFormField(OBJECT parent, STRING type, STRING name, RECORD options)
Append a new field to the form
- OBJECT FUNCTION BeginWork(RECORD options)
Begin transactional work
- MACRO CheckRateLimits()
- MACRO EnableCaptcha(RECORD options)
- STRING FUNCTION FormatFormDate(DATETIME value, RECORD options)
- RECORD FUNCTION FormExecuteSubmit(RECORD options)
Submit the form using its current values
- OBJECT FUNCTION GetFormField(STRING findname)
Get a field by name
- RECORD ARRAY FUNCTION GetFormPages()
- STRING FUNCTION GetFormTarget()
- RECORD FUNCTION GetIndexableContent(RECORD options)
- RECORD FUNCTION GetRenderTree()
- RECORD FUNCTION GetWittyData()
- RECORD FUNCTION GetWittyResultData(RECORD options)
- OBJECT FUNCTION GetWRDAuthPlugin()
- RECORD ARRAY FUNCTION ListFields()
- RECORD FUNCTION MatchFormCondition(RECORD condition, RECORD result)
- MACRO PrefillWithSingleResult(RECORD results)
- MACRO PrepareForFrontend()
- RECORD FUNCTION PrepareFormDataForComposer(OBJECT mailcomposer, RECORD options)
- MACRO RenderForm()
- RECORD FUNCTION RunFormFilter()
- MACRO SetFormValues(RECORD ARRAY vals, RECORD options)
Set form values using a flat array. Safer when fieldnames may be long
- STRING FUNCTION StoreFormValue(RECORD options)
Store the current value of the form