Class: Form

FormComponents. Form


new Form()

This component is responsible for rendering all form components
as well as updating the form's field data in the FormStore.

Source:

Members


<static> boundResource

Container for the bound resource

Source:

<static> formFields

Container for all form field components.
This is only for observation of child components, not for modifying them.

Source:

<static> validator

Instantiating the internal validate for later assignment.

Source:

Methods


<static> componentDidMount()

componentDidMount

Source:
Returns:
Type
null

<static> componentWillMount()

Handle attaching universal properties to all children

Source:
Returns:
Type
null

<static> componentWillReceiveProps(nextProps)

Form component receives props on every parent state change (when form fields are edited). On these events,
we need to sync the form's resource with parent's state.

Parameters:
Name Type Description
nextProps object
Source:
Returns:
Type
null

<static> componentWillUnmount()

componentWillUnmount

Source:
Returns:
Type
null

<static> determineColumnSize()

determineColumnSize

Source:
To Do:
  • this might be helpful to fully flesh out and use
Returns:
Type
null

<static> getInitialState()

getInitialState

Source:
Returns:
Type
object

<static> getNestedFieldKeys(obj)

Takes an object with infinitely nested values and grabs the paths to all values

Example:
var obj = {a: 1, b: {c: 2}};
getNestedFieldKeys(obj); // ['a', 'b.c']

Parameters:
Name Type Description
obj object

The object to be flattened

Source:
Returns:

An array of paths to all values on the object

Type
array

<static> handleChange(path, value, component)

Master parent change handler for every child form field component.

Parameters:
Name Type Description
path string

The path to the value on the object. e.g.'user.first_name'

value *

The value of the Form at the path

component ReactComponent

The component the change came from

Source:
Returns:
Type
null

<static> handleSubmit(event)

Determine if there's an onSubmit handler available

Parameters:
Name Type Description
event
Source:
Returns:
Type
null

<static> render()

Renders the form and all of its children

Source:
Returns:
Type
jsx

<static> syncBoundResource(resource, isValid)

Bubble up form's boundResource with parent state.

Parameters:
Name Type Description
resource *
isValid boolean
Source:

<static> traverseChildren(children)

Dynamically (recursively) traverse every child component and set some universal properties for them.

Parameters:
Name Type Description
children *
Source:
Returns:
Type
*

<static> validate(component, value)

Built upon http://christianalfoni.github.io/javascript/2014/10/22/nailing-that-validation-with-reactjs.html

Parameters:
Name Type Description
component ReactComponent
value *
Source:
Returns:
Type
boolean

<static> validateAndRegisterFormAgainstSchema()

When there's a schema, handles validating the form and registering it.

This is used to flag invalid fields on page-load

Source:
Returns:
Type
null

<static> validateForm()

Validate form in full

Source:
Returns:
Type
null