Namespace: FormComponents

FormComponents

Form components are varied in implementation, but all focus on one thing: editing data.
All Form components can live outside of the '

', but wrapping them in '' adds a lot of functionality. For example, automatic updating of bound resources via the FormStore.

In the below example, we require the Mortar Form, and create a working resource with the property "first_name". We then bind that resource to the form, and reference the path to that key in Br.Form.Input. The input is rendered with the value specified in 'workingResource'. Now, any changes to that input field will be caught by the Form, and a change event will be fired in the 'FormStore'.

Registering a change listener to the 'FormStore' will allow changes to be picked up in our component, and let us 'setState()' with any changes.

Source:

Example

var Br = MortarJS.require('components', 'Form');
var FormStore = MortarJS.Stores.FormStore;

// in the component:
workingResource = {first_name: 'Kyle'}

// in component.render
<Br.Form key="a string" formKey="unique string" bindResource={this.workingResource}>
	<Br.Form.Input fieldKey="first_name" type="text" label="First Name" />
</Br.Form>

Classes

CharacterCount
Checkbox
DatePicker
DropdownSelect
FileInput
FizzyWig
Form
FormValidator
Input
MediumEditor
MultipleSelectBox
RadioButton
SelectBox
SubmitButton
TextArea
TimePicker
TypeAheadInput