 ST.class 'EnumFieldView', 'View', ->
   @initializer 'withValuesNull', (values, _null) ->
     @init()
-    @_value = null
+    @_value = if _null then null else values[0][1]
     @_null = _null
     @_values = values
     @_valueIndex = {}

  @property 'values'
  @property 'selectElement'
  @property 'id'
  
  @method 'render', ->
    @_selectElement = $ '<select />'

        @_skipUpdate = true
        @value newValue
  
  @method 'setValue', (newValue) ->
    if @isValueValid(newValue)
      @_value = newValue
      if @_skipUpdate
        @_skipUpdate = false
      else if @_loaded
        @_selectElement[0].selectedIndex = if @_valueIndex[newValue]? then @_valueIndex[newValue] else 0
  
  @method '_valuesChanged', (oldValues, newValues) ->
    @value null unless @isValueValid(@value)
    @renderOptions() if @_loaded
  
  @method '_idChanged', (oldValue, newValue) ->
