silverstripe-framework/admin/client/src/components/Form
Damian Mooyman 6e74b57c36 BUG Fix issue with gulpfile.js not compiling client/src/legacy dir
BUG Make SelectionGroup.ss and SelectionGroup.js work together
BUG Fix for IE visual indentation of composite field
2016-07-28 16:32:40 +12:00
..
Form.js Update Form component to just Form 2016-06-03 15:52:31 +12:00
Form.scss BUG Fix issue with gulpfile.js not compiling client/src/legacy dir 2016-07-28 16:32:40 +12:00
FormConstants.js API Add CSRF to Campaign delete 2016-05-09 17:33:10 +12:00
README.md Fixed case sensitive naming regressions 2016-04-26 15:32:09 +12:00

FormComponent

The FormComponent is used to render forms in SilverStripe. The only time you should need to use FormComponent directly is when you're composing custom layouts. Forms can be automatically generated from a schema using the FormBuilder component.

This component should be moved to Framework when dependency injection is implemented.

Props

actions (required)

A list of objects representing the form actions. For example the submit button.

attributes (required)

An object of HTML attributes for the form. For example:

{
    action: 'admin/assets/EditForm',
    class: 'cms-edit-form root-form AssetAdmin LeftAndMain',
    enctype: 'multipart/form-data',
    id: 'Form_EditForm',
    method: 'POST'
}

componentWillUnmount (func)

Optional function which will be called in the component's 'native' componentWillUnmount method.

This can be used to tidy up Redux state that's no longer required.

data

Ad hoc data passed to the front-end from the server.

fields (required)

A list of field objects to display in the form. These objects should be transformed to Components using the this.props.mapFieldsToComponents method.

mapFieldsToComponents (required)

A function that maps each schema field (this.props.fields) to the component responsibe for render it.

handleSubmit (func)

Called then the form is submitted.