       is_valid = false
       @refs[attr.ref].setError? 'Required field'
       break
-    setTimeout (=> @props.onChange? event, @), 10
+    setTimeout (=> @props.onChange event, @), 10 if @props.onChange?
 
   # -- Render
   render: ->
-    <fieldset data-react-toolbox='fieldset'
+    <div data-react-toolbox='fieldset'
               className={@props.className} onChange={@onChange}>
       { <label>{@props.label}</label> if @props.label }
       {
         for attribute, index in @state.attributes
-          if attribute.type is 'label'
+          if attribute.type is TYPE.LABEL
             <label>{attribute.caption}</label>
-          else if attribute.type is 'autocomplete'
+          else if attribute.type is TYPE.AUTOCOMPLETE
             <Autocomplete key={index} {...attribute} onChange={@onChange}/>
-          else if attribute.type is 'dropdown'
+          else if attribute.type is TYPE.DROPDOWN
             <Dropdown key={index} {...attribute} onChange={@onChange}/>
-          else if attribute.type is 'switch'
+          else if attribute.type is TYPE.SWITCH
             <Switch key={index} {...attribute} onChange={@onChange}/>
           else
             <Input key={index} {...attribute} />
       }
       { @props.children }
-    </fieldset>
+    </div>
 
   # -- Extends
   clean: ->

@todo
###

Autocomplete  = require '../autocomplete'
Dropdown      = require '../dropdown'
Input         = require '../input'
Switch        = require '../switch'

module.exports = React.createClass



  getValue: ->
    value = {}
    if @state.type isnt TYPE.RADIO
      value[ref] = input.getValue() for ref, input of @refs when input.getValue?
    else
      value = ref for ref, input of @refs when input.getValue?() is true
    value

  setValue: (data = {}) ->
    if data instanceof Object
      @refs[key]?.setValue? value for key, value of data
    else
      @refs[key].setValue? key is data for key of @refs

# -- Internal methods
_determineType = (attributes) ->
  type = ''
  group_radio     = true
  group_checkbox  = true
  for attribute in attributes when attribute.type isnt TYPE.LABEL
    group_radio = false if attribute.type isnt TYPE.RADIO
    group_checkbox = false if attribute.type isnt TYPE.CHECKBOX
  type = TYPE.RADIO if group_radio
  type = TYPE.CHECKBOX if group_checkbox
  type
